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

            Bug ID: 89594
           Summary: [9 Regression] ICE: Segmentation fault (in
                    gsi_for_stmt(gimple*))
           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-alpha20190303 snapshot (r269357) ICEs when compiling the following
testcase w/ -O1 -ftree-loop-if-convert -ftree-loop-vectorize -fno-tree-ch:

int h3;

void
in (void)
{
  long int zr;
  int ee = 0;

  for (zr = 0; zr < 1; zr = h3)
    {
      ee = !!h3 ? zr : 0;

      h3 = 0;
      while (h3 < 0)
        h3 = 0;
    }

  h3 = 0;
  while (h3 < 1)
    h3 = !!ee ? (!!h3 + 1) : 0;
}

% gcc-9.0.0-alpha20190303 -O1 -ftree-loop-if-convert -ftree-loop-vectorize
-fno-tree-ch -c fu9roqfs.c
during GIMPLE pass: ifcvt
fu9roqfs.c: In function 'in':
fu9roqfs.c:4:1: internal compiler error: Segmentation fault
    4 | in (void)
      | ^~
0xd6fc4f crash_signal
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/toplev.c:326
0xab3157 gsi_for_stmt(gimple*)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/gimple-iterator.c:609
0xdb03c4 fold_loop_internal_call(gimple*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/tree-cfg.c:7418
0xde7f5e execute
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/tree-if-conv.c:3184
0xde7f5e execute
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/tree-if-conv.c:3137

==19053== Invalid read of size 4
==19053==    at 0xAB3157: gsi_for_stmt(gimple*) (gimple-iterator.c:609)
==19053==    by 0xDB03C4: fold_loop_internal_call(gimple*, tree_node*)
(tree-cfg.c:7418)
==19053==    by 0xDE7F5E: execute (tree-if-conv.c:3184)
==19053==    by 0xDE7F5E: (anonymous
namespace)::pass_if_conversion::execute(function*) (tree-if-conv.c:3137)
==19053==    by 0xC8CF89: execute_one_pass(opt_pass*) (passes.c:2487)
==19053==    by 0xC8D6EF: execute_pass_list_1(opt_pass*) (passes.c:2573)
==19053==    by 0xC8D701: execute_pass_list_1(opt_pass*) (passes.c:2574)
==19053==    by 0xC8D701: execute_pass_list_1(opt_pass*) (passes.c:2574)
==19053==    by 0xC8D728: execute_pass_list(function*, opt_pass*)
(passes.c:2584)
==19053==    by 0x94B28F: cgraph_node::expand() (cgraphunit.c:2198)
==19053==    by 0x94C22A: expand_all_functions (cgraphunit.c:2336)
==19053==    by 0x94C22A: symbol_table::compile() [clone .part.0]
(cgraphunit.c:2687)
==19053==    by 0x94E8CC: compile (cgraphunit.c:2599)
==19053==    by 0x94E8CC: symbol_table::finalize_compilation_unit()
(cgraphunit.c:2865)
==19053==    by 0xD6FF3E: compile_file() (toplev.c:481)
==19053==  Address 0x50 is not stack'd, malloc'd or (recently) free'd

Reply via email to