This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] pr36753, fwprop interacts badly with global register variable
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 17 Jul 2008 08:03:10 +0200
- Subject: [PATCH] pr36753, fwprop interacts badly with global register variable
Global register are live on entry, so accesses before a definition are
not uninitialized.
Tested i686-pc-linux-gnu, ok for mainline?
Paolo
2008-07-17 Paolo Bonzini <bonzini@gnu.org>
* fwprop.c (use_killed_between): Don't shortcut
single-definition global registers.
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. */