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 PR39941


This fixes PR39941.  We have to update SSA form after replacing
an indirect call with a direct call as that may uncover differences
in attribute qualifications.

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

Richard.

2009-04-29  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/39941
	* tree-ssa-pre.c (eliminate): Schedule update-ssa after
	eliminating an indirect call.

	* gcc.c-torture/compile/pr39941.c: New testcase.

Index: gcc/tree-ssa-pre.c
===================================================================
*** gcc/tree-ssa-pre.c	(revision 146927)
--- gcc/tree-ssa-pre.c	(working copy)
*************** eliminate (void)
*** 4131,4136 ****
--- 4131,4141 ----
  		  update_stmt (stmt);
  		  if (maybe_clean_or_replace_eh_stmt (stmt, stmt))
  		    gimple_purge_dead_eh_edges (b);
+ 
+ 		  /* Changing an indirect call to a direct call may
+ 		     have exposed different semantics.  This may
+ 		     require an SSA update.  */
+ 		  todo |= TODO_update_ssa;
  		}
  	    }
  	}
Index: gcc/testsuite/gcc.c-torture/compile/pr39941.c
===================================================================
*** gcc/testsuite/gcc.c-torture/compile/pr39941.c	(revision 0)
--- gcc/testsuite/gcc.c-torture/compile/pr39941.c	(revision 0)
***************
*** 0 ****
--- 1,12 ----
+ typedef void (*entry_func) (void) __attribute__ ((noreturn));
+ extern entry_func entry_addr;
+ static void bsd_boot_entry (void)
+ {
+   stop ();
+ }   
+ void bsd_boot (void)
+ {
+   entry_addr = (entry_func) bsd_boot_entry;
+   (*entry_addr) ();
+ }
+ 


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