* [PATCH] Fix PR83277
@ 2017-12-05 15:04 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2017-12-05 15:04 UTC (permalink / raw)
To: gcc-patches
The following fixes a code-gen error in GRAPHITE. liveout handling
is still somewhat flaky and the easiest fix is to force code generation
of defs where ISL scheduled them (rather than at the PHI edge src).
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2017-12-05 Richard Biener <rguenther@suse.de>
PR tree-optimization/83277
* graphite-isl-ast-to-gimple.c (should_copy_to_new_region): Make sure
to code-gen liveout vars.
* gcc.dg/graphite/pr83277.c: New testcase.
Index: gcc/graphite-isl-ast-to-gimple.c
===================================================================
--- gcc/graphite-isl-ast-to-gimple.c (revision 255402)
+++ gcc/graphite-isl-ast-to-gimple.c (working copy)
@@ -1137,8 +1137,10 @@ should_copy_to_new_region (gimple *stmt,
if (is_gimple_assign (stmt)
&& (lhs = gimple_assign_lhs (stmt))
&& TREE_CODE (lhs) == SSA_NAME
- && is_gimple_reg (lhs)
- && scev_analyzable_p (lhs, region->region))
+ && scev_analyzable_p (lhs, region->region)
+ /* But to code-generate liveouts - liveout PHI generation is
+ in generic sese.c code that cannot do code generation. */
+ && ! bitmap_bit_p (region->liveout, SSA_NAME_VERSION (lhs)))
return false;
return true;
Index: gcc/testsuite/gcc.dg/graphite/pr83277.c
===================================================================
--- gcc/testsuite/gcc.dg/graphite/pr83277.c (nonexistent)
+++ gcc/testsuite/gcc.dg/graphite/pr83277.c (working copy)
@@ -0,0 +1,52 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -floop-nest-optimize" } */
+
+int rk, si = 0;
+int jr[2];
+
+int
+wv (signed char n8)
+{
+ const int tw = 8;
+ int xq[tw];
+ int bj, pu = 0;
+
+ for (bj = 0; bj < tw; ++bj)
+ xq[bj] = 0;
+
+ bj = 0;
+ while (bj < 1)
+ {
+ int gs = n8 ^ 128;
+
+ if (gs != 0)
+ {
+ int u7[3];
+
+ while (bj < 2)
+ {
+ u7[bj] = 0;
+ ++bj;
+ }
+
+ jr[0] = u7[0];
+ rk = xq[0];
+ pu = n8;
+
+ if (si != 0)
+ return si;
+ }
+ }
+
+ return pu;
+}
+
+int
+main (void)
+{
+ signed char ax = 1;
+
+ if (wv (ax) != ax)
+ __builtin_abort ();
+ return 0;
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-12-05 15:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-05 15:04 [PATCH] Fix PR83277 Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).