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

            Bug ID: 126556
           Summary: [15/16/17 Regression] ICE at -O2 on aarch64 during RTL
                    pass: combine
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xxs_chy at outlook dot com
  Target Milestone: ---

Reproducer: https://godbolt.org/z/McTjq89Ed
Testcase:
#include <stdint.h>
#define BITCAST(DST_TYPE, SRC_TYPE, VALUE)                                    
\
    (union {                                                                  
\
        SRC_TYPE src;                                                         
\
        DST_TYPE dst                                                          
\
    }){ VALUE }                                                               
\
        .dst
typedef uint8_t v4u8 __attribute__((vector_size(4)));
typedef uint8_t fp_t_7(_Bool, uint16_t, uint32_t, void *);
void *f9_a3;
_Bool f9_c4()
{
    uint8_t v6;
    uint32_t bb8;
    v4u8 bc11;
    fp_t_7 fp13;
    bc11 = BITCAST(v4u8, uint32_t, bb8);
    v6 = bc11[3];
    bc11[(int8_t)v6 > 0] = v6;
    f9_a3 = &bc11;
    fp13(f9_c4, 1098, 8038, f9_a3);
}

Dump at -O2:
during RTL pass: combine
/tmp/tmpbs9ho86k/case.c: In function 'f9':
/tmp/tmpbs9ho86k/case.c:4552:1: internal compiler error: in do_SUBST, at
combine.cc:717
 4552 | }
      | ^
0x274420d internal_error(char const*, ...)
       
/data/Projects/compiler-test-env/cte-work/src/gcc/gcc/diagnostic-global-context.cc:787
0xb137eb fancy_abort(char const*, int, char const*)
       
/data/Projects/compiler-test-env/cte-work/src/gcc/gcc/diagnostics/context.cc:1813
0xac5b61 do_SUBST
        /data/Projects/compiler-test-env/cte-work/src/gcc/gcc/combine.cc:717
0x23c298c simplify_set
        /data/Projects/compiler-test-env/cte-work/src/gcc/gcc/combine.cc:6919
0x23c5892 subst
        /data/Projects/compiler-test-env/cte-work/src/gcc/gcc/combine.cc:5665
0x23c988f try_combine
        /data/Projects/compiler-test-env/cte-work/src/gcc/gcc/combine.cc:3323
0x23cf353 combine_instructions
        /data/Projects/compiler-test-env/cte-work/src/gcc/gcc/combine.cc:1273
0x23cf353 rest_of_handle_combine
        /data/Projects/compiler-test-env/cte-work/src/gcc/gcc/combine.cc:15227
0x23cf353 execute
        /data/Projects/compiler-test-env/cte-work/src/gcc/gcc/combine.cc:15271

Reply via email to