https://gcc.gnu.org/bugzilla/show_bug.cgi?id=129114

            Bug ID: 129114
           Summary: [14/15/16/17 Regression] ICE at -O1 and above:
                    verify_gimple failed ("invalid types in nop
                    conversion", long int <- float) in forwprop with
                    generic 256-bit vectors, __builtin_convertvector and
                    __builtin_shuffle
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: haoxintu at gmail dot com
  Target Milestone: ---

Hi,

$cat repro.c

typedef int v4si __attribute__((vector_size(16)));
typedef float v4sf __attribute__((vector_size(16)));
typedef long v4di __attribute__((vector_size(32)));
typedef double v4df __attribute__((vector_size(32)));
v4sf e;

v4si f(void) {
  v4df j, l;   /* deliberately uninitialized: compile-only testcase */
  v4df h = __builtin_convertvector(e, v4df);
  v4di i = 0 >= __builtin_convertvector(j, v4di);
  v4df g = __builtin_shuffle((v4df)((v4di)h & i), (v4di){});
  v4df k = __builtin_shuffle(__builtin_shuffle(l, (v4di)g), (v4di){});
  return __builtin_convertvector(k, v4si);
}

$ gcc -O1 -c -w repro.c
repro.c: In function 'f':
repro.c:7:6: error: invalid types in nop conversion
    7 | v4si f(void) {
      |      ^
long int
float
_42 = (long int) _17;
during GIMPLE pass: forwprop
repro.c:7:6: internal compiler error: verify_gimple failed
0x1448772 verify_gimple_in_cfg(function*, bool, bool)
        ../../gcc/tree-cfg.cc:5654
0x129c3fe execute_function_todo
        ../../gcc/passes.cc:2105


-O1, -O2, -O3 and -Os all ICE; `-fno-tree-forwprop` avoids it. 

Reproduced in Godbolt (gcc trunk, -O1 -c): https://godbolt.org/z/sd5jb11P7

## Checked versions
- gcc trunk 4eca40b54dd (2026-11-25, --enable-checking=yes): ICE at
-O1/-O2/-O3/-Os
- gcc 16.0.1, 16.2, 15.2, 15.3, 14.4, 13.4, 12.2: same ICE
- gcc 11.4, 10.5, 9.5 (Godbolt): compile it


Thanks.

Reply via email to