aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-pre.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-04-11 07:34:20 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-04-11 07:34:20 +0000
commit3bab738598b67b501fd1411ef43f9c9f36f13297 (patch)
tree1f6fce6719b7ea38d1b0298dc475a7a3472cf9cf /gcc/tree-ssa-pre.c
parent2fd579ab530ca9ca5682eeba305c4946bf710c25 (diff)
downloadgcc-3bab738598b67b501fd1411ef43f9c9f36f13297.zip
gcc-3bab738598b67b501fd1411ef43f9c9f36f13297.tar.gz
gcc-3bab738598b67b501fd1411ef43f9c9f36f13297.tar.bz2
re PR tree-optimization/90020 (-O2 -Os x86-64 wrong code generated for GNU Emacs)
2019-04-11 Richard Biener <rguenther@suse.de> PR tree-optimization/90020 * tree-ssa-sccvn.c (vn_reference_may_trap): New function. * tree-ssa-sccvn.h (vn_reference_may_trap): Declare. * tree-ssa-pre.c (compute_avail): Use it to not put possibly trapping references after a call that might not return into EXP_GEN. * gcse.c (compute_hash_table_work): Do not elide marking a block containing a call if the call might not return. * gcc.dg/torture/pr90020.c: New testcase. From-SVN: r270275
Diffstat (limited to 'gcc/tree-ssa-pre.c')
-rw-r--r--gcc/tree-ssa-pre.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 3f38371..7bb2cf1 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -3931,6 +3931,13 @@ compute_avail (void)
continue;
}
+ /* If the REFERENCE traps and there was a preceding
+ point in the block that might not return avoid
+ adding the reference to EXP_GEN. */
+ if (BB_MAY_NOTRETURN (block)
+ && vn_reference_may_trap (ref))
+ continue;
+
/* If the value of the reference is not invalidated in
this block until it is computed, add the expression
to EXP_GEN. */