This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR82402


The following fixes a missing SSA_NAME_OCCURS_IN_ABNORMAL_PHI.

Tested on x86_64-unknown-linux-gnu, applied.

Richard.

2017-11-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82402
	* tree-vect-loop-manip.c (create_lcssa_for_virtual_phi): Properly
	set SSA_NAME_OCCURS_IN_ABNORMAL_PHI.

	* gcc.dg/torture/pr82402.c: New testcase.

Index: gcc/tree-vect-loop-manip.c
===================================================================
--- gcc/tree-vect-loop-manip.c	(revision 255137)
+++ gcc/tree-vect-loop-manip.c	(working copy)
@@ -639,6 +639,8 @@ create_lcssa_for_virtual_phi (struct loo
 	    gimple *stmt;
 	    use_operand_p use_p;
 
+	    SSA_NAME_OCCURS_IN_ABNORMAL_PHI (new_vop)
+	      = SSA_NAME_OCCURS_IN_ABNORMAL_PHI (vop);
 	    add_phi_arg (new_phi, vop, exit_e, UNKNOWN_LOCATION);
 	    gimple_phi_set_result (new_phi, new_vop);
 	    FOR_EACH_IMM_USE_STMT (stmt, imm_iter, vop)
Index: gcc/testsuite/gcc.dg/torture/pr82402.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/pr82402.c	(nonexistent)
+++ gcc/testsuite/gcc.dg/torture/pr82402.c	(working copy)
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+typedef int jmp_buf[1];
+
+extern void exit(int) __attribute__((__noreturn__));
+extern int setjmpx(jmp_buf) __attribute__((__returns_twice__));
+
+jmp_buf jbAnagram;
+int a[6];
+int d;
+int b () { exit (1); }
+int c () { b (); }
+int e ()
+{
+  int f = 0;
+  for (; f < 6; f++)
+    a[f] = d;
+  c ();
+  setjmpx (jbAnagram);
+}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]