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

            Bug ID: 127000
           Summary: [17 Regression] ICE at -O2 during GIMPLE pass: fre
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xxs_chy at outlook dot com
  Target Milestone: ---

Reproducer: https://godbolt.org/z/c3aYo1dP1
Reduced case:
#include <stdint.h>
typedef void *fp_t_2;
void *g8, *g11, *g19;
fp_t_2 f18f31_fp3;
void f18f31(uint64_t a0)
{
    g8 = 0;
    a0 = (char *)g11 - (char *)g8;
    *(uint64_t *)g19 = a0;
    f18f31_fp3 = *(fp_t_2 *)g19;
}

This case causes ICE on trunk, but older versions on Compiler Explorer just
hang,
Dump at -O2:
./reduced.c: In function ‘f18f31’:
./reduced.c:11:1: error: invalid operand in unary operation
   11 | }
      | ^
_13 = (void *) (void *) g11.0_1;
during GIMPLE pass: fre
./reduced.c:11:1: internal compiler error: verify_gimple failed
0x285673d internal_error(char const*, ...)
       
/data/Projects/compiler-test-env/cte-work/src/gcc/gcc/diagnostic-global-context.cc:787
0x12b2bb0 verify_gimple_in_cfg(function*, bool, bool)
        /data/Projects/compiler-test-env/cte-work/src/gcc/gcc/tree-cfg.cc:5642
0x1117f5a execute_function_todo
        /data/Projects/compiler-test-env/cte-work/src/gcc/gcc/passes.cc:2100
0x1118497 execute_todo
        /data/Projects/compiler-test-env/cte-work/src/gcc/gcc/passes.cc:2152
/data/Projects/compiler-test-env/cte-work/toolchains/gcc/x86_64-linux-gnu/libexec/gcc/x86_64-linux-gnu/17.0.0/cc1
-quiet -imultiarch x86_64-linux-gnu ./reduced.c -quiet -dumpdir a- -dumpbase
reduced.c -dumpbase-ext .c -mtune=generic -march=x86-64 -O2 -o /tmp/ccgjqSXI.s

Reply via email to