Skip to content

[SimplifyCFG][LLVM 23.x] foldTwoEntryPHINode change from 9e4dddcc12a7 breaks fixed point tests in Release bootstrap #217532

Description

@amy-kwan

9e4dddc is causing the following FixedPoint test case failures on PPC64LE and AIX:

  Clang :: Frontend/fixed_point_add_const.c
  Clang :: Frontend/fixed_point_div_const.c
  Clang :: Frontend/fixed_point_errors.c
  Clang :: Frontend/fixed_point_mul_const.c
  LLVM-Unit :: ADT/./ADTTests/FixedPoint/add
  LLVM-Unit :: ADT/./ADTTests/FixedPoint/div
  LLVM-Unit :: ADT/./ADTTests/FixedPoint/mul
  • These seem to only occur on Release ON + Asserts OFF bootstrap builds only
  • The failures occur during a bootstrap build (stage 2/3) - these were discovered when running the in-tree test-release.sh release testing script
  • Occurs on both main and release/23.x - since it occurs in main, there is no fix for it yet.
Sample LIT failure output:
FAIL: Clang :: Frontend/fixed_point_add_const.c
******************** TEST 'Clang :: Frontend/fixed_point_add_const.c' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
<build>/bin/clang -cc1 -internal-isystem <build>/lib/clang/23/include -nostdsysteminc -ffixed-point -triple x86_64-unknown-linux-gnu -emit-llvm <src>/clang/test/Frontend/fixed_point_add_const.c -o - | <build>/bin/FileCheck <src>/clang/test/Frontend/fixed_point_add_const.c --check-prefixes=CHECK,SIGNED
# executed command: <build>/bin/clang -cc1 -internal-isystem <build>/lib/clang/23/include -nostdsysteminc -ffixed-point -triple x86_64-unknown-linux-gnu -emit-llvm <src>/clang/test/Frontend/fixed_point_add_const.c -o -
# executed command: <build>/bin/FileCheck <src>/clang/test/Frontend/fixed_point_add_const.c --check-prefixes=CHECK,SIGNED
# .---command stderr------------
# | <src>/clang/test/Frontend/fixed_point_add_const.c:46:16: error: SIGNED-DAG: expected string not found in input
# | // SIGNED-DAG: @sat_usa_const = {{.*}}global i16 -1, align 2
# |                ^
# | <stdin>:1:1: note: scanning from here
# | ; ModuleID = '<src>/clang/test/Frontend/fixed_point_add_const.c'
# | ^
# | <stdin>:22:1: note: possible intended match here
# | @sat_usa_const2 = global i16 -1, align 2
# | ^
# |
# | Input file: <stdin>
# | Check file: <src>/clang/test/Frontend/fixed_point_add_const.c
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<<<<<
# |           1: ; ModuleID = '<src>/clang/test/Frontend/fixed_point_add_const.c'
# | dag:46'0    {                                                                   search range start (exclusive)
# | dag:46'1                                                                        error: no match found in search range
# |           2: source_filename = "<src>/clang/test/Frontend/fixed_point_add_const.c"
# |           3: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
# |           4: target triple = "x86_64-unknown-linux-gnu"
# |           5:
# |           6: @sa_const = global i16 384, align 2
# |           .
# |           .
# |          17: @sa_const8 = global i16 32640, align 2
# |          18: @lf_const = global i32 1073741824, align 4
# |          19: @sat_sa_const = global i16 32767, align 2
# |          20: @sat_usa_const = global i16 0, align 2
# |          21: @sat_sa_const2 = global i16 32767, align 2
# |          22: @sat_usa_const2 = global i16 -1, align 2
# | dag:46'2     ?                                          possible intended match
# |          23: @sat_usa_const3 = global i16 0, align 2
# | dag:46'3    }                                           search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

********************
FAIL: Clang :: Frontend/fixed_point_errors.c
******************** TEST 'Clang :: Frontend/fixed_point_errors.c' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
<build>/bin/clang -cc1 -internal-isystem <build>/lib/clang/23/include -nostdsysteminc -verify -ffixed-point <src>/clang/test/Frontend/fixed_point_errors.c
# executed command: <build>/bin/clang -cc1 -internal-isystem <build>/lib/clang/23/include -nostdsysteminc -verify -ffixed-point <src>/clang/test/Frontend/fixed_point_errors.c
# RUN: at line 2
<build>/bin/clang -cc1 -internal-isystem <build>/lib/clang/23/include -nostdsysteminc -verify -ffixed-point <src>/clang/test/Frontend/fixed_point_errors.c -fexperimental-new-constant-interpreter
# executed command: <build>/bin/clang -cc1 -internal-isystem <build>/lib/clang/23/include -nostdsysteminc -verify -ffixed-point <src>/clang/test/Frontend/fixed_point_errors.c -fexperimental-new-constant-interpreter
# .---command stderr------------
# | error: 'expected-warning' diagnostics seen but not expected:
# |   File <src>/clang/test/Frontend/fixed_point_errors.c Line 260: implicit conversion from -1.0 cannot fit within the range of values for 'short _Accum'
# | 1 error generated.
# `-----------------------------
# error: command failed with exit status: 1

--

********************
FAIL: Clang :: Frontend/fixed_point_mul_const.c
******************** TEST 'Clang :: Frontend/fixed_point_mul_const.c' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
<build>/bin/clang -cc1 -internal-isystem <build>/lib/clang/23/include -nostdsysteminc -ffixed-point -triple x86_64-unknown-linux-gnu -emit-llvm <src>/clang/test/Frontend/fixed_point_mul_const.c -o - | <build>/bin/FileCheck <src>/clang/test/Frontend/fixed_point_mul_const.c --check-prefixes=CHECK,SIGNED
# executed command: <build>/bin/clang -cc1 -internal-isystem <build>/lib/clang/23/include -nostdsysteminc -ffixed-point -triple x86_64-unknown-linux-gnu -emit-llvm <src>/clang/test/Frontend/fixed_point_mul_const.c -o -
# .---command stderr------------
# | <src>/clang/test/Frontend/fixed_point_mul_const.c:5:31: warning: overflow in expression; result is 4.0 with type 'short _Accum' [-Wfixed-point-overflow]
# |     5 | short _Accum sa_const = 2.0hk * 2.0hk;
# |       |                               ^
# | <src>/clang/test/Frontend/fixed_point_mul_const.c:7:24: warning: overflow in expression; result is 6.0 with type '_Accum' [-Wfixed-point-overflow]
# |     7 | _Accum a_const = 3.0hk * 2.0k;
# |       |                        ^
# | <src>/clang/test/Frontend/fixed_point_mul_const.c:9:30: warning: overflow in expression; result is 8.0 with type 'long _Accum' [-Wfixed-point-overflow]
# |     9 | long _Accum la_const = 4.0hk * 2.0lk;
# |       |                              ^
# | <src>/clang/test/Frontend/fixed_point_mul_const.c:11:32: warning: overflow in expression; result is 1.0 with type 'short _Accum' [-Wfixed-point-overflow]
# |    11 | short _Accum sa_const2 = 0.5hr * 2.0hk;
# |       |                                ^
# | <src>/clang/test/Frontend/fixed_point_mul_const.c:13:31: warning: overflow in expression; result is 1.5 with type 'short _Accum' [-Wfixed-point-overflow]
# |    13 | short _Accum sa_const3 = 0.5r * 3.0hk;
# |       |                               ^
# | <src>/clang/test/Frontend/fixed_point_mul_const.c:15:32: warning: overflow in expression; result is 2.0 with type 'short _Accum' [-Wfixed-point-overflow]
# |    15 | short _Accum sa_const4 = 0.5lr * 4.0hk;
# |       |                                ^
# | <src>/clang/test/Frontend/fixed_point_mul_const.c:24:34: warning: overflow in expression; result is 60.0 with type 'short _Accum' [-Wfixed-point-overflow]
# |    24 | short _Accum sa_const5 = 20.0uhk * 3.0hk;
# |       |                                  ^
# | <src>/clang/test/Frontend/fixed_point_mul_const.c:28:32: warning: overflow in expression; result is -1.0 with type 'short _Accum' [-Wfixed-point-overflow]
# |    28 | short _Accum sa_const6 = 0.5hr * (-2.0hk);
# |       |                                ^
# | <src>/clang/test/Frontend/fixed_point_mul_const.c:32:38: warning: overflow in expression; result is 52.5 with type 'unsigned short _Accum' [-Wfixed-point-overflow]
# |    32 | unsigned short _Accum usa_const2 = 5 * 10.5uhk;
# |       |                                      ^
# | <src>/clang/test/Frontend/fixed_point_mul_const.c:35:28: warning: overflow in expression; result is -1.5 with type 'short _Accum' [-Wfixed-point-overflow]
# |    35 | short _Accum sa_const7 = 3 * (-0.5hk);
# |       |                            ^
# | <src>/clang/test/Frontend/fixed_point_mul_const.c:37:30: warning: overflow in expression; result is -200.0 with type 'short _Accum' [-Wfixed-point-overflow]
# |    37 | short _Accum sa_const8 = 100 * (-2.0hk);
# |       |                              ^
# | <src>/clang/test/Frontend/fixed_point_mul_const.c:39:32: warning: overflow in expression; result is -0.75 with type 'long _Fract' [-Wfixed-point-overflow]
# |    39 | long _Fract lf_const = -0.25lr * 3;
# |       |                                ^
# | 12 warnings generated.
# `-----------------------------
# executed command: <build>/bin/FileCheck <src>/clang/test/Frontend/fixed_point_mul_const.c --check-prefixes=CHECK,SIGNED
# .---command stderr------------
# | <src>/clang/test/Frontend/fixed_point_mul_const.c:46:16: error: SIGNED-DAG: expected string not found in input
# | // SIGNED-DAG: @sat_usa_const = {{.*}}global i16 -1, align 2
# |                ^
# | <stdin>:1:1: note: scanning from here
# | ; ModuleID = '<src>/clang/test/Frontend/fixed_point_mul_const.c'
# | ^
# | <stdin>:22:1: note: possible intended match here
# | @sat_usa_const2 = global i16 -1, align 2
# | ^
# |
# | Input file: <stdin>
# | Check file: <src>/clang/test/Frontend/fixed_point_mul_const.c
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<<<<<
# |           1: ; ModuleID = '<src>/clang/test/Frontend/fixed_point_mul_const.c'
# | dag:46'0    {                                                                   search range start (exclusive)
# | dag:46'1                                                                        error: no match found in search range
# |           2: source_filename = "<src>/clang/test/Frontend/fixed_point_mul_const.c"
# |           3: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
# |           4: target triple = "x86_64-unknown-linux-gnu"
# |           5:
# |           6: @sa_const = global i16 512, align 2
# |           .
# |           .
# |          17: @sa_const8 = global i16 -25600, align 2
# |          18: @lf_const = global i32 -1610612736, align 4
# |          19: @sat_sa_const = global i16 32767, align 2
# |          20: @sat_usa_const = global i16 0, align 2
# |          21: @sat_sa_const2 = global i16 -32768, align 2
# |          22: @sat_usa_const2 = global i16 -1, align 2
# | dag:46'2     ?                                          possible intended match
# |          23: @sat_usa_const3 = global i16 0, align 2
# | dag:46'3    }                                           search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

********************
FAIL: Clang :: Frontend/fixed_point_div_const.c
******************** TEST 'Clang :: Frontend/fixed_point_div_const.c' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
<build>/bin/clang -cc1 -internal-isystem <build>/lib/clang/23/include -nostdsysteminc -ffixed-point -triple x86_64-unknown-linux-gnu -emit-llvm <src>/clang/test/Frontend/fixed_point_div_const.c -o - | <build>/bin/FileCheck <src>/clang/test/Frontend/fixed_point_div_const.c --check-prefixes=CHECK,SIGNED
# executed command: <build>/bin/clang -cc1 -internal-isystem <build>/lib/clang/23/include -nostdsysteminc -ffixed-point -triple x86_64-unknown-linux-gnu -emit-llvm <src>/clang/test/Frontend/fixed_point_div_const.c -o -
# .---command stderr------------
# | <src>/clang/test/Frontend/fixed_point_div_const.c:8:31: warning: overflow in expression; result is 0.5 with type 'short _Accum' [-Wfixed-point-overflow]
# |     8 | short _Accum sa_const = 1.0hk / 2.0hk;
# |       |                               ^
# | <src>/clang/test/Frontend/fixed_point_div_const.c:10:24: warning: overflow in expression; result is 0.5 with type '_Accum' [-Wfixed-point-overflow]
# |    10 | _Accum a_const = 1.0hk / 2.0k;
# |       |                        ^
# | <src>/clang/test/Frontend/fixed_point_div_const.c:12:30: warning: overflow in expression; result is 0.5 with type 'long _Accum' [-Wfixed-point-overflow]
# |    12 | long _Accum la_const = 1.0hk / 2.0lk;
# |       |                              ^
# | <src>/clang/test/Frontend/fixed_point_div_const.c:14:32: warning: overflow in expression; result is 0.25 with type 'short _Accum' [-Wfixed-point-overflow]
# |    14 | short _Accum sa_const2 = 0.5hr / 2.0hk;
# |       |                                ^
# | <src>/clang/test/Frontend/fixed_point_div_const.c:16:31: warning: overflow in expression; result is 0.25 with type 'short _Accum' [-Wfixed-point-overflow]
# |    16 | short _Accum sa_const3 = 0.5r / 2.0hk;
# |       |                               ^
# | <src>/clang/test/Frontend/fixed_point_div_const.c:18:32: warning: overflow in expression; result is 0.25 with type 'short _Accum' [-Wfixed-point-overflow]
# |    18 | short _Accum sa_const4 = 0.5lr / 2.0hk;
# |       |                                ^
# | <src>/clang/test/Frontend/fixed_point_div_const.c:20:32: warning: overflow in expression; result is 4.0 with type 'short _Accum' [-Wfixed-point-overflow]
# |    20 | short _Accum sa_const5 = 2.0hk / 0.5lr;
# |       |                                ^
# | <src>/clang/test/Frontend/fixed_point_div_const.c:29:33: warning: overflow in expression; result is 0.5 with type 'short _Accum' [-Wfixed-point-overflow]
# |    29 | short _Accum sa_const6 = 1.0uhk / 2.0hk;
# |       |                                 ^
# | <src>/clang/test/Frontend/fixed_point_div_const.c:33:32: warning: overflow in expression; result is -0.25 with type 'short _Accum' [-Wfixed-point-overflow]
# |    33 | short _Accum sa_const7 = 0.5hr / (-2.0hk);
# |       |                                ^
# | <src>/clang/test/Frontend/fixed_point_div_const.c:37:38: warning: overflow in expression; result is 4.0 with type 'unsigned short _Accum' [-Wfixed-point-overflow]
# |    37 | unsigned short _Accum usa_const2 = 2 / 0.5uhk;
# |       |                                      ^
# | <src>/clang/test/Frontend/fixed_point_div_const.c:40:28: warning: overflow in expression; result is -4.0 with type 'short _Accum' [-Wfixed-point-overflow]
# |    40 | short _Accum sa_const8 = 2 / (-0.5hk);
# |       |                            ^
# | <src>/clang/test/Frontend/fixed_point_div_const.c:42:30: warning: overflow in expression; result is 128.0 with type 'short _Accum' [-Wfixed-point-overflow]
# |    42 | short _Accum sa_const9 = 256 / 2.0hk;
# |       |                              ^
# | <src>/clang/test/Frontend/fixed_point_div_const.c:44:30: warning: overflow in expression; result is -0.5 with type 'long _Fract' [-Wfixed-point-overflow]
# |    44 | long _Fract lf_const = 0.5lr / -1;
# |       |                              ^
# | <src>/clang/test/Frontend/fixed_point_div_const.c:65:41: warning: overflow in expression; result is 1.0 with type 'short _Accum' [-Wfixed-point-overflow]
# |    65 | short _Accum sa_const10 = 255.9921875hk / 255.9921875hk;
# |       |                                         ^
# | <src>/clang/test/Frontend/fixed_point_div_const.c:71:41: warning: overflow in expression; result is -255.9921875 with type 'short _Accum' [-Wfixed-point-overflow]
# |    71 | short _Accum sa_const12 = 255.9921875hk / -1.0hk;
# |       |                                         ^
# | <src>/clang/test/Frontend/fixed_point_div_const.c:75:39: warning: overflow in expression; result is 0.0078125 with type 'short _Accum' [-Wfixed-point-overflow]
# |    75 | short _Accum sa_const13 = 0.0234375hk / 2.0hk;
# |       |                                       ^
# | <src>/clang/test/Frontend/fixed_point_div_const.c:77:40: warning: overflow in expression; result is -0.015625 with type 'short _Accum' [-Wfixed-point-overflow]
# |    77 | short _Accum sa_const14 = -0.0234375hk / 2.0hk;
# |       |                                        ^
# | <src>/clang/test/Frontend/fixed_point_div_const.c:79:40: warning: overflow in expression; result is -0.0078125 with type 'short _Accum' [-Wfixed-point-overflow]
# |    79 | short _Accum sa_const15 = -0.0078125hk / 255.28125hk;
# |       |                                        ^
# | 18 warnings generated.
# `-----------------------------
# executed command: <build>/bin/FileCheck <src>/clang/test/Frontend/fixed_point_div_const.c --check-prefixes=CHECK,SIGNED
# .---command stderr------------
# | <src>/clang/test/Frontend/fixed_point_div_const.c:51:16: error: SIGNED-DAG: expected string not found in input
# | // SIGNED-DAG: @sat_usa_const = {{.*}}global i16 -1, align 2
# |                ^
# | <stdin>:1:1: note: scanning from here
# | ; ModuleID = '<src>/clang/test/Frontend/fixed_point_div_const.c'
# | ^
# | <stdin>:21:1: note: possible intended match here
# | @sat_usa_const = global i16 0, align 2
# | ^
# |
# | Input file: <stdin>
# | Check file: <src>/clang/test/Frontend/fixed_point_div_const.c
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<<<<<
# |           1: ; ModuleID = '<src>/clang/test/Frontend/fixed_point_div_const.c'
# | dag:51'0    {                                                                   search range start (exclusive)
# | dag:51'1                                                                        error: no match found in search range
# |           2: source_filename = "<src>/clang/test/Frontend/fixed_point_div_const.c"
# |           3: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
# |           4: target triple = "x86_64-unknown-linux-gnu"
# |           5:
# |           6: @sa_const = global i16 64, align 2
# |           .
# |           .
# |          16: @usa_const2 = global i16 1024, align 2
# |          17: @sa_const8 = global i16 -512, align 2
# |          18: @sa_const9 = global i16 16384, align 2
# |          19: @lf_const = global i32 -1073741824, align 4
# |          20: @sat_sa_const = global i16 -32768, align 2
# |          21: @sat_usa_const = global i16 0, align 2
# | dag:51'2     ?                                        possible intended match
# |          22: @sat_sa_const2 = global i16 32767, align 2
# |          23: @sat_usa_const2 = global i16 0, align 2
# |          24: @sat_usa_const3 = global i16 0, align 2
# |          25: @sat_sa_const3 = global i16 -128, align 2
# |          26: @sat_sa_const4 = global i16 -32768, align 2
# |           .
# |           .
# |          33: @sa_const14 = global i16 -2, align 2
# |          34: @sa_const15 = global i16 -1, align 2
# | dag:51'3    }                                         search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

********************

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status
    Needs Fix

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions