This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/21596] [4.0/4.1/4.2/4.3 Regression] extra temporaries when using global register variables
- From: "bonzini at gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Mar 2007 08:22:53 -0000
- Subject: [Bug tree-optimization/21596] [4.0/4.1/4.2/4.3 Regression] extra temporaries when using global register variables
- References: <bug-21596-119@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #10 from bonzini at gnu dot org 2007-03-07 08:22 -------
Unfortunately, if I fix the fwprop bug (which is actually caused by wrong df
information), I get again
leal -4(%edi), %eax
movl %eax, %edi
movl (%eax), %eax
testl %eax, %eax
The df bug is fixed by:
Index: ../../base-gcc-src/gcc/df-scan.c
===================================================================
--- ../../base-gcc-src/gcc/df-scan.c (revision 122624)
+++ ../../base-gcc-src/gcc/df-scan.c (working copy)
@@ -1833,6 +1833,13 @@ df_record_entry_block_defs (struct dataf
#endif
}
+ /* Mark all global registers as being defined at the entry of the
+ function since values set by our caller should not be treated as
+ uninitialized. */
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (global_regs[i])
+ bitmap_set_bit (df->entry_block_defs, i);
+
/* Once the prologue has been generated, all of these registers
should just show up in the first regular block. */
if (HAVE_prologue && epilogue_completed)
--
bonzini at gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bonzini at gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21596