* [PATCH] Fix PR78312
@ 2016-11-14 10:29 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2016-11-14 10:29 UTC (permalink / raw)
To: gcc-patches
backprop changes values of SSA names - while it properly handles
debug info it fails to reset range/align info.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2016-11-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/78312
* gimple-ssa-backprop.c (backprop::prepare_change): Reset
flow-sensitive info.
* gcc.dg/torture/pr78312.c: New testcase.
Index: gcc/gimple-ssa-backprop.c
===================================================================
--- gcc/gimple-ssa-backprop.c (revision 242066)
+++ gcc/gimple-ssa-backprop.c (working copy)
@@ -728,6 +728,7 @@ backprop::prepare_change (tree var)
{
if (MAY_HAVE_DEBUG_STMTS)
insert_debug_temp_for_var_def (NULL, var);
+ reset_flow_sensitive_info (var);
}
/* STMT has been changed. Give the fold machinery a chance to simplify
Index: gcc/testsuite/gcc.dg/torture/pr78312.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/pr78312.c (revision 0)
+++ gcc/testsuite/gcc.dg/torture/pr78312.c (working copy)
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+
+typedef unsigned short u16;
+
+static u16 a;
+
+u16 __attribute__ ((noinline, noclone))
+foo (int p1)
+{
+ a = -(p1 > 0);
+ a *= 0 != a;
+ a *= (unsigned)a;
+ return a;
+}
+
+int
+main ()
+{
+ u16 x = foo (1);
+ if (x != 1)
+ __builtin_abort();
+ return 0;
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-11-14 10:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-14 10:29 [PATCH] Fix PR78312 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).