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

            Bug ID: 107505
           Summary: [13 Regression] ICE: verify_flow_info failed (error:
                    returns_twice call is not first in basic block 2)
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: ice-checking, ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

An obligatory abnormal edge issue of the week.

gcc 13.0.0 20221030 snapshot (g:f36bba013361d8d4f9c7237c3307630de0cc0416) ICEs
when compiling the following testcase w/ -O2 -fno-guess-branch-probability:

int n;

void
bar (void);

__attribute__ ((noinline, returns_twice)) int
zero (void)
{
  return 0;
}

void
foo (void)
{
  int a = zero ();

  for (n = 0; n < 2; ++n)
    {
    }

  if (a)
    bar ();
}

% gcc-13 -O2 -fno-guess-branch-probability -c u9i2um01.c
u9i2um01.c: In function 'foo':
u9i2um01.c:13:1: error: returns_twice call is not first in basic block 2
   13 | foo (void)
      | ^~~
_7 = zero ();
during GIMPLE pass: cddce
u9i2um01.c:13:1: internal compiler error: verify_flow_info failed
0xa10ebd verify_flow_info()
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221030/work/gcc-13-20221030/gcc/cfghooks.cc:284
0xf529c4 checking_verify_flow_info
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221030/work/gcc-13-20221030/gcc/cfghooks.h:214
0xf529c4 cleanup_tree_cfg_noloop
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221030/work/gcc-13-20221030/gcc/tree-cfgcleanup.cc:1161
0xf529c4 cleanup_tree_cfg(unsigned int)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221030/work/gcc-13-20221030/gcc/tree-cfgcleanup.cc:1212
0xe0b79c execute_function_todo
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221030/work/gcc-13-20221030/gcc/passes.cc:2057
0xe0bbfe execute_todo
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221030/work/gcc-13-20221030/gcc/passes.cc:2145

Reply via email to