[Committed, PR69108] Handle case that outer phi res is not used in a phi in gather_scalar_reductions

Tom de Vries Tom_deVries@mentor.com
Mon Jan 11 09:30:00 GMT 2016


when compiling interchange-2.c with ftree-parallelize-loops=2 we run 
into an ICE:
$ gcc -O2 src/gcc/testsuite/gcc.dg/graphite/interchange-2.c -S 
interchange-2.c: In function ‘foo.constprop’:
interchange-2.c:13:1: internal compiler error: in as_a, at is-a.h:192
  foo (int N, int *res)

The problem is in the double reduction handling code added in r226300:
          bool single_use_p = single_imm_use (res, &use_p, &inner_stmt);
          gcc_assert (single_use_p);
          gphi *inner_phi = as_a <gphi *> (inner_stmt);

The code assumes that inner_stmt is a phi, but the ICE shows that it's 
possible that that's not the case.

The patch fixes the problem conservatively by testing if inner_stmt is a 
PHI, and handling the non-phi case.

Bootstrapped and reg-tested on x86_64.

Committed to trunk.

- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Handle-case-that-outer-phi-res-is-not-used-in-a-phi-in-gather_scalar_reductions.patch
Type: text/x-patch
Size: 1332 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160111/70b78281/attachment.bin>

More information about the Gcc-patches mailing list