Commit 2ad04111 by Richard Biener Committed by Richard Biener

re PR tree-optimization/86865 (Wrong code w/ -O2 -floop-parallelize-all…

re PR tree-optimization/86865 (Wrong code w/ -O2 -floop-parallelize-all -fstack-reuse=none -fwrapv -fno-tree-ch -fno-tree-dce -fno-tree-dominator-opts -fno-tree-loop-ivcanon)

2019-01-25  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/86865
	* graphite-scop-detection.c (scop_detection::can_represent_loop):
	Reject non-do-while loops.

	* gcc.dg/graphite/pr86865.c: New testcase.
	* gcc.dg/graphite/pr69728.c: XFAIL.
	* gcc.dg/graphite/scop-21.c: Likewise.

From-SVN: r268257
parent bb58a17b
2019-01-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/86865
* graphite-scop-detection.c (scop_detection::can_represent_loop):
Reject non-do-while loops.
2019-01-24 Peter Bergner <bergner@linux.ibm.com>
* config/rs6000/altivec.md (build_vector_mask_for_load): Use MEM_P.
......
......@@ -555,8 +555,15 @@ scop_detection::can_represent_loop (loop_p loop, sese_l scop)
tree niter;
struct tree_niter_desc niter_desc;
return single_exit (loop)
&& !(loop_preheader_edge (loop)->flags & EDGE_IRREDUCIBLE_LOOP)
/* We can only handle do {} while () style loops correctly. */
edge exit = single_exit (loop);
if (!exit
|| !single_pred_p (loop->latch)
|| exit->src != single_pred (loop->latch)
|| !empty_block_p (loop->latch))
return false;
return !(loop_preheader_edge (loop)->flags & EDGE_IRREDUCIBLE_LOOP)
&& number_of_iterations_exit (loop, single_exit (loop), &niter_desc, false)
&& niter_desc.control.no_overflow
&& (niter = number_of_latch_executions (loop))
......
2019-01-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/86865
* gcc.dg/graphite/pr86865.c: New testcase.
* gcc.dg/graphite/pr69728.c: XFAIL.
* gcc.dg/graphite/scop-21.c: Likewise.
2019-01-24 Martin Sebor <msebor@redhat.com>
PR c/86125
......
......@@ -24,4 +24,6 @@ fn1 ()
run into scheduling issues before here, not being able to handle
empty domains. */
/* { dg-final { scan-tree-dump "loop nest optimized" "graphite" } } */
/* XFAILed by fix for PR86865. */
/* { dg-final { scan-tree-dump "loop nest optimized" "graphite" { xfail *-*-* } } } */
/* { dg-do run } */
/* { dg-options "-O2 -fgraphite-identity -fstack-reuse=none -fwrapv -fno-tree-ch -fno-tree-dce -fno-tree-dominator-opts -fno-tree-loop-ivcanon" } */
int xy, tb;
void
bt (void)
{
for (xy = 0; xy >= 0; --xy)
{
int yt[8] = { 0 };
int pz[2] = { 0 };
int sa[32] = { 0 };
int us;
for (us = 0; us < 8; ++us)
yt[us] = 0;
(void) yt;
(void) pz;
(void) sa;
}
tb = 1;
}
int
main (void)
{
bt ();
if (xy != -1)
__builtin_abort ();
return 0;
}
......@@ -30,4 +30,5 @@ int test ()
return a[20];
}
/* { dg-final { scan-tree-dump-times "number of SCoPs: 1" 1 "graphite"} } */
/* XFAILed by the fix for PR86865. */
/* { dg-final { scan-tree-dump-times "number of SCoPs: 1" 1 "graphite" { xfail *-*-* } } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment