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

            Bug ID: 87267
           Summary: [9 Regression] ICE: Segmentation fault (in
                    gimple_truth_valued_p)
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Keywords: 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: ---

gcc-9.0.0-alpha20180909 snapshot (r264185; actually, gcc-9.0.0-alpha20180902,
r264045) ICEs when compiling the following snippet w/ -O2
-fno-tree-dominator-opts -fno-tree-forwprop:

unsigned long int
re (long int j9)
{
  if (j9 == 0)
    return 1;

  return j9;
}

void
zq (int bt, int yy)
{
  int p3 = 0, go = 4, ez = go;

  while (go != 0)
    {
      if (ez + !!bt - re (bt) != 0 && go != 0)
        {
          if (yy != 0)
            p3 = yy;
        }
      else
        return;

      go = 2;
    }
}

void
my (unsigned long int n6, int bt, int yy)
{
  zq (bt, yy);
  n6 = n6 == bt;
  zq (bt, yy);
}

% gcc-9.0.0-alpha20180909 -O2 -fno-tree-dominator-opts -fno-tree-forwprop -c
osda2bvg.c
during GIMPLE pass: pre
osda2bvg.c: In function 'my':
osda2bvg.c:30:1: internal compiler error: Segmentation fault
30 | my (unsigned long int n6, int bt, int yy)
   | ^~
0xcb76df crash_signal
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/toplev.c:325
0x1029ab8 gimple_truth_valued_p(tree_node*, tree_node* (*)(tree_node*))
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/build/gcc/gimple-match.c:238
0x1126141 gimple_simplify_EQ_EXPR
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/build/gcc/gimple-match.c:72667
0x103087e gimple_simplify
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/build/gcc/gimple-match.c:86182
0x103276f gimple_resimplify2(gimple**, gimple_match_op*, tree_node*
(*)(tree_node*))
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/gimple-match-head.c:285
0x113bfb5 gimple_simplify(gimple*, gimple_match_op*, gimple**, tree_node*
(*)(tree_node*), tree_node* (*)(tree_node*))
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/gimple-match-head.c:1012
0xd0587d cleanup_control_expr_graph
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-cfgcleanup.c:149
0xd0587d cleanup_control_flow_bb
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-cfgcleanup.c:247
0xd05ff1 cleanup_control_flow_pre
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-cfgcleanup.c:757
0xd06379 cleanup_tree_cfg_noloop
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-cfgcleanup.c:881
0xd06379 cleanup_tree_cfg()
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-cfgcleanup.c:989
0xe9450c tail_merge_optimize(unsigned int)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-ssa-tail-merge.c:1747
0xe3b39b execute
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-ssa-pre.c:4255

Reply via email to