* [PATCH] Fix PR81083
@ 2017-06-14 7:21 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2017-06-14 7:21 UTC (permalink / raw)
To: gcc-patches
The following fixes PR81083, we shouldn't end up with abnormals as SSA
vals, even as VN hash value.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk
sofar.
Richard.
2017-06-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/81083
* tree-ssa-sccvn.c (vn_reference_lookup_3): Do not use abnormals
as values.
* gcc.dg/torture/pr81083.c: New testcase.
Index: gcc/tree-ssa-sccvn.c
===================================================================
--- gcc/tree-ssa-sccvn.c (revision 249145)
+++ gcc/tree-ssa-sccvn.c (working copy)
@@ -2035,7 +2035,9 @@ vn_reference_lookup_3 (ao_ref *ref, tree
ops[1] = bitsize_int (ref->size);
ops[2] = bitsize_int (offset - offset2);
tree val = vn_nary_build_or_lookup (rcode, vr->type, ops);
- if (val)
+ if (val
+ && (TREE_CODE (val) != SSA_NAME
+ || ! SSA_NAME_OCCURS_IN_ABNORMAL_PHI (val)))
{
vn_reference_t res = vn_reference_lookup_or_insert_for_pieces
(vuse, vr->set, vr->type, vr->operands, val);
Index: gcc/testsuite/gcc.dg/torture/pr81083.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/pr81083.c (nonexistent)
+++ gcc/testsuite/gcc.dg/torture/pr81083.c (working copy)
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+void a(int arg)
+{
+ extern struct { int x; } obj;
+ setjmp();
+ obj.x = arg;
+ arg = arg;
+ if (obj.x)
+ func();
+ if (obj.x)
+ func();
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-14 7:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-14 7:21 [PATCH] Fix PR81083 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).