------- Comment #9 from bonzini at gnu dot org  2008-07-14 16:29 -------
In fact, using modified_between_p would not fix the bug.  The problem is that
use_killed_between gives the wrong answer *before* it reaches the code that
"redoes" modified_between_p using df data structures.

I'll regtest this patch tomorrow because the machine is right now too busy. 
But if anyone wants to beat me, feel free.

Index: ../../peak-gcc-src/gcc/fwprop.c
===================================================================
--- ../../peak-gcc-src/gcc/fwprop.c     (revision 136756)
+++ ../../peak-gcc-src/gcc/fwprop.c     (working copy)
@@ -480,10 +480,15 @@ use_killed_between (struct df_ref *use, 
     return true;

   /* Check if the reg in USE has only one definition.  We already
-     know that this definition reaches use, or we wouldn't be here.  */
+     know that this definition reaches use, or we wouldn't be here.
+     However, this is not true for hard registers, because if they are
+     live at the beginning of the function it does not mean that we
+     have an uninitialized access.  */
   regno = DF_REF_REGNO (use);
   def = DF_REG_DEF_CHAIN (regno);
-  if (def && (def->next_reg == NULL))
+  if (def
+      && (def->next_reg == NULL)
+      && regno >= FIRST_PSEUDO_REGISTER)
     return false;

   /* Check locally if we are in the same basic block.  */


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36753

Reply via email to