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

            Bug ID: 87349
           Summary: [9 Regression] ICE: Segmentation fault (in
                    useless_type_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-alpha20180916 snapshot (r264351) ICEs when compiling the following
snippets w/ -O1 or -Og:

1.

void
h1 (int *fh, int pw)
{
  *fh = 0;
  if (*fh != 0)
    for (;;)
      {
        fh = &pw;

        if (pw == 0)
          {
          }
        else
          while (pw < 1)
            {
              if (pw == 0)
                {
 ut:
                  ;
                }

              ++pw;
            }

        if (pw == *fh)
          goto ut;
      }

  goto ut;
}

% gcc-9.0.0-alpha20180916 -O1 -c nshv93ku.c
during GIMPLE pass: fre
nshv93ku.c: In function 'h1':
nshv93ku.c:30:1: internal compiler error: Segmentation fault
30 | }
   | ^
0xcc84df crash_signal
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180916/work/gcc-9-20180916/gcc/toplev.c:325
0xa296f0 useless_type_conversion_p(tree_node*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180916/work/gcc-9-20180916/gcc/gimple-expr.c:70
0xd0149c verify_gimple_assign_single
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180916/work/gcc-9-20180916/gcc/tree-cfg.c:4390
0xd0149c verify_gimple_assign
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180916/work/gcc-9-20180916/gcc/tree-cfg.c:4612
0xd0149c verify_gimple_stmt
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180916/work/gcc-9-20180916/gcc/tree-cfg.c:4880
0xd107b3 verify_gimple_in_cfg(function*, bool)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180916/work/gcc-9-20180916/gcc/tree-cfg.c:5358
0xbe74af execute_function_todo
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180916/work/gcc-9-20180916/gcc/passes.c:1943
0xbe839e execute_todo
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180916/work/gcc-9-20180916/gcc/passes.c:1997

2.

--- nshv93ku.c.jj       2018-09-18 15:40:38.439857690 +0700
+++ nshv93ku.c  2018-09-18 15:40:59.678335059 +0700
@@ -22,7 +22,7 @@ h1 (int *fh, int pw)
               ++pw;
             }

-        if (pw == 0)
+        if (pw == *fh)
           goto ut;
       }


during GIMPLE pass: fre
nshv93ku.c: In function 'h1':
nshv93ku.c:30:1: internal compiler error: Segmentation fault
30 | }
   | ^
0xcc84df crash_signal
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180916/work/gcc-9-20180916/gcc/toplev.c:325
0xa2abc1 is_gimple_reg_type
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180916/work/gcc-9-20180916/gcc/gimple-expr.h:75
0xa2abc1 is_gimple_val(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180916/work/gcc-9-20180916/gcc/gimple-expr.c:789
0xd1044a verify_gimple_phi
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180916/work/gcc-9-20180916/gcc/tree-cfg.c:4975
0xd1044a verify_gimple_in_cfg(function*, bool)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180916/work/gcc-9-20180916/gcc/tree-cfg.c:5303
0xbe74af execute_function_todo
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180916/work/gcc-9-20180916/gcc/passes.c:1943
0xbe839e execute_todo
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180916/work/gcc-9-20180916/gcc/passes.c:1997

Reply via email to