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

            Bug ID: 87266
           Summary: [9 Regression] ICE: Segmentation fault (in
                    useless_type_conversion_p, tree_nop_conversion_p, or
                    is_gimple_reg_type)
           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 (-O3, -Ofast, -Os)
-fno-tree-ccp -fno-tree-forwprop:

1.

void
iw (int gu, int mq, int r2)
{
  int yn = 0;

  while (gu < 1)
    {
      for (;;)
        ;

 bb:;
      int ay = 0;

      while (ay < 1)
        ++mq;
    }

  if (yn != 0)
    goto up;

  if (0)
    {
 up:
      if (r2 == 0)
        goto bb;
    }

  goto up;
}

% gcc-9.0.0-alpha20180909 -O2 -fno-tree-ccp -fno-tree-forwprop -c nuni7epw.c
during GIMPLE pass: fre
nuni7epw.c: In function 'iw':
nuni7epw.c:29:1: internal compiler error: Segmentation fault
29 | }
   | ^
0xcb76df crash_signal
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/toplev.c:325
0xa197c0 useless_type_conversion_p(tree_node*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/gimple-expr.c:70
0xe4065f may_propagate_copy(tree_node*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-ssa-propagate.c:1260
0xcf78fc gimple_merge_blocks
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-cfg.c:2070
0x89ab0f merge_blocks(basic_block_def*, basic_block_def*)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/cfghooks.c:793
0xd05061 cleanup_tree_cfg_bb
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-cfgcleanup.c:719
0xd063e8 cleanup_tree_cfg_noloop
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-cfgcleanup.c:905
0xd063e8 cleanup_tree_cfg()
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-cfgcleanup.c:989
0xbd71ec execute_function_todo
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/passes.c:1896
0xbd804e execute_todo
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/passes.c:1997

2.

--- nuni7epw.c.jj       2018-09-10 10:54:29.671619781 +0700
+++ nuni7epw.c  2018-09-10 10:54:37.730536962 +0700
@@ -11,7 +11,7 @@ iw (int gu, int mq, int r2)
  bb:;
       int ay = 0;

-      while (ay < 1)
+      while (yn < 1)
         ++mq;
     }


% gcc-9.0.0-alpha20180909 -O2 -fno-tree-ccp -fno-tree-forwprop -c nuni7epw.c
during GIMPLE pass: fre             
nuni7epw.c: In function 'iw':
nuni7epw.c:29:1: internal compiler error: Segmentation fault
29 | }
   | ^
0xcb76df crash_signal
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/toplev.c:325
0xf482d9 tree_nop_conversion_p(tree_node const*, tree_node const*)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree.c:12184
0x10c3c18 gimple_simplify_166
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/build/gcc/gimple-match.c:8176
0x10d323d gimple_simplify_LE_EXPR
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/build/gcc/gimple-match.c:71030
0x10308d2 gimple_simplify
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/build/gcc/gimple-match.c:86180
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
0xbd71ec execute_function_todo
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/passes.c:1896
0xbd804e execute_todo
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/passes.c:1997

3.

--- nuni7epw.c.jj       2018-09-10 10:54:29.671619781 +0700
+++ nuni7epw.c  2018-09-10 10:56:44.197236464 +0700
@@ -5,12 +5,12 @@ iw (int gu, int mq, int r2)

   while (gu < 1)
     {
+      int ay = 0;
+
       for (;;)
         ;

- bb:;
-      int ay = 0;
-
+ bb:
       while (ay < 1)
         ++mq;
     }

% gcc-9.0.0-alpha20180909 -O2 -fno-tree-ccp -fno-tree-forwprop -c nuni7epw.c
during GIMPLE pass: fre
nuni7epw.c: In function 'iw':
nuni7epw.c:29:1: internal compiler error: Segmentation fault
29 | }
   | ^
0xcb76df crash_signal
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/toplev.c:325
0xa1ac91 is_gimple_reg_type
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/gimple-expr.h:75
0xa1ac91 is_gimple_val(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/gimple-expr.c:789
0xcff40a verify_gimple_phi
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-cfg.c:4975
0xcff40a verify_gimple_in_cfg(function*, bool)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/tree-cfg.c:5303
0xbd715f execute_function_todo
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/passes.c:1943
0xbd804e execute_todo
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180909/work/gcc-9-20180909/gcc/passes.c:1997

Reply via email to