diff mbox

Fix PR63738

Message ID alpine.LSU.2.11.1411261157590.374@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener Nov. 26, 2014, 10:58 a.m. UTC
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.
diff mbox

Patch

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;
+}