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

            Bug ID: 111942
           Summary: ICE in rtl_split_edge, at cfgrtl.cc:1943 on pr98096.c
                    with new -fharden-control-flow-redundancy
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mjires at suse dot cz
                CC: aoliva at gcc dot gnu.org
  Target Milestone: ---

Following testcase causes ICE with new -fharden-control-flow-redundancy

$ cat pr98096.c
/* Test for correct naming of label operands in asm goto in case of presence of
   input/output operands. */
/* { dg-do compile { target lra } } */
int i, j;
int f(void) {
  asm goto ("# %0 %2" : "+r" (i) ::: jmp);
  i += 2;
  asm goto ("# %0 %1 %l[jmp]" : "+r" (i), "+r" (j) ::: jmp);
 jmp: return i;
}



$ gcc pr98096.c -fharden-control-flow-redundancy -fnon-call-exceptions
during RTL pass: expand
pr98096.c: In function ‘f’:
pr98096.c:10:1: internal compiler error: in rtl_split_edge, at cfgrtl.cc:1943
   10 | }
      | ^
0x755d25 rtl_split_edge
        /home/mjires/git/GCC/master/gcc/cfgrtl.cc:1943
0xad6acb split_edge(edge_def*)
        /home/mjires/git/GCC/master/gcc/cfghooks.cc:670
0xaec884 commit_one_edge_insertion(edge_def*)
        /home/mjires/git/GCC/master/gcc/cfgrtl.cc:2058
0xaf14e1 commit_edge_insertions()
        /home/mjires/git/GCC/master/gcc/cfgrtl.cc:2127
0xad2a1d execute
        /home/mjires/git/GCC/master/gcc/cfgexpand.cc:6906
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ gcc -v
Using built-in specs.
COLLECT_GCC=/home/mjires/checks/master/bin/gcc
COLLECT_LTO_WRAPPER=/home/mjires/checks/master/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/checks/master
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20231023 (experimental) (GCC)

Reply via email to