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 PR43379


This fixes PR43379, for VOPs we need to merge 
SSA_NAME_OCCURS_IN_ABNORMAL_PHI when propagating single-argument
PHIs.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2010-03-16  Richard Guenther  <rguenther@suse.de>

	PR middle-end/43379
	* tree-cfg.c (gimple_merge_blocks): When propagating virtual
	PHI operands make sure to merge SSA_NAME_OCCURS_IN_ABNORMAL_PHI
	properly.

	* gcc.dg/pr43379.c: New testcase.

Index: gcc/tree-cfg.c
===================================================================
*** gcc/tree-cfg.c	(revision 157475)
--- gcc/tree-cfg.c	(working copy)
*************** gimple_merge_blocks (basic_block a, basi
*** 1617,1622 ****
--- 1617,1625 ----
  	      FOR_EACH_IMM_USE_STMT (stmt, iter, def)
  		FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
  		  SET_USE (use_p, use);
+ 
+ 	      if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (def))
+ 		SSA_NAME_OCCURS_IN_ABNORMAL_PHI (use) = 1;
  	    }
  	  else
              replace_uses_by (def, use);
Index: gcc/testsuite/gcc.dg/pr43379.c
===================================================================
*** gcc/testsuite/gcc.dg/pr43379.c	(revision 0)
--- gcc/testsuite/gcc.dg/pr43379.c	(revision 0)
***************
*** 0 ****
--- 1,11 ----
+ /* { dg-do compile } */
+ /* { dg-options "-O2 -ftracer" } */
+ 
+ void *foo(int i, int *p)
+ {
+ lab:
+   if (p) *p = i;
+   goto *p;
+   return &&lab;
+ }
+ 


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