[PATCH] Fix df_get_entry_block_def_set for struct_value REGNOs (PR rtl-optimization/32636)

Jakub Jelinek jakub@redhat.com
Thu Dec 13 16:42:00 GMT 2007


df_get_entry_block_def_set doesn't want to mark several regs as live on
entry once prologues/epilogues have been completed:
  /* Once the prologue has been generated, all of these registers
     should just show up in the first regular block.  */
  if (HAVE_prologue && epilogue_completed)
      /* Defs for the callee saved registers are inserted so that the
         pushes have some defining location.  */
      for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
        if ((call_used_regs[i] == 0) && (df_regs_ever_live_p (i)))
          bitmap_set_bit (entry_block_defs, i);

but this justification doesn't hold for struct_value_rtx if it is
a call used REG.  Because then the epilogue_completed code won't mark
it, even when it is needed.  Fixed by the patch below, by moving marking
of struct_value_rtx outside of the else.  Dave Anglin kindly bootstrapped/
regtested this hppa2.0w-hp-hpux11.11 and hppa-linux
and I have bootstrapped/regtested this on {i686,x86_64,ppc,ppc64}-linux.
No testcase included, as we have one already in libstdc++ testsuite
for this.

Ok for trunk?

2007-12-11  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/32636
	* df-scan.c (df_get_entry_block_def_set): Set struct_value_rtx
	regno in entry_block_defs even if HAVE_prologue && epilogue_completed.

--- gcc/df-scan.c.jj	2007-10-26 13:45:44.000000000 +0200
+++ gcc/df-scan.c	2007-12-11 22:24:21.000000000 +0100
@@ -3530,12 +3530,12 @@ df_get_entry_block_def_set (bitmap entry
       bitmap_set_bit (entry_block_defs, STATIC_CHAIN_REGNUM);
-      r = targetm.calls.struct_value_rtx (current_function_decl, true);
-      if (r && REG_P (r))
-	bitmap_set_bit (entry_block_defs, REGNO (r));
+  r = targetm.calls.struct_value_rtx (current_function_decl, true);
+  if (r && REG_P (r))
+    bitmap_set_bit (entry_block_defs, REGNO (r));
   if ((!reload_completed) || frame_pointer_needed)
       /* Any reference to any pseudo before reload is a potential


More information about the Gcc-patches mailing list