This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR63738
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 26 Nov 2014 11:58:54 +0100 (CET)
- Subject: [PATCH] Fix PR63738
- Authentication-results: sourceware.org; auth=none
I am testing the following (obvious) patch to avoid generating overlapping
life-ranges for SSA names that occur in abnormal PHIs.
Bootstrap and regtest running on x86_64-unknown-linux-gnu.
Richard.
2014-11-26 Richard Biener <rguenther@suse.de>
PR middle-end/63738
* tree-data-ref.c (split_constant_offset_1): Do not follow
SSA edges for SSA names with SSA_NAME_OCCURS_IN_ABNORMAL_PHI.
* gcc.dg/torture/pr63738.c: New testcase.
Index: gcc/tree-data-ref.c
===================================================================
--- gcc/tree-data-ref.c (revision 218076)
+++ gcc/tree-data-ref.c (working copy)
@@ -674,6 +674,9 @@ split_constant_offset_1 (tree type, tree
case SSA_NAME:
{
+ if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (op0))
+ return false;
+
gimple def_stmt = SSA_NAME_DEF_STMT (op0);
enum tree_code subcode;
Index: gcc/testsuite/gcc.dg/torture/pr63738.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/pr63738.c (revision 0)
+++ gcc/testsuite/gcc.dg/torture/pr63738.c (working copy)
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+#include <setjmp.h>
+
+struct longjmp_buffer {
+ jmp_buf buf;
+};
+
+void plouf();
+
+extern long interprete()
+{
+ long * sp;
+ int i;
+ long *args;
+ int n;
+
+ struct longjmp_buffer raise_buf;
+ _setjmp (raise_buf.buf);
+
+ plouf();
+ sp -= 4;
+ for (i = 0; i < n; i++)
+ args[i] = sp[10-i];
+ plouf();
+ return 0;
+}