[617118d] | 1 | Submitted by: Ryan Oliver <ryan.oliver@pha.com.au> |
---|
| 2 | Source: http://gcc.gnu.org/ml/gcc-cvs/2005-04/msg01085.html |
---|
| 3 | Initial Package Version: 4.0.0 |
---|
| 4 | Upstream Status: In gcc4 mainline |
---|
| 5 | Description: |
---|
| 6 | |
---|
| 7 | 2005-04-20 Michael Matz <matz@suse.de> |
---|
| 8 | |
---|
| 9 | PR20973 |
---|
| 10 | * reload.c (push_reload, find_dummy_reload): Check for uninitialized |
---|
| 11 | pseudos. |
---|
| 12 | |
---|
| 13 | =================================================================== |
---|
| 14 | RCS file: /cvs/gcc/gcc/gcc/reload.c,v |
---|
| 15 | retrieving revision 1.268 |
---|
| 16 | retrieving revision 1.269 |
---|
| 17 | diff -u -r1.268 -r1.269 |
---|
| 18 | --- gcc/gcc/reload.c 2005/02/24 22:06:06 1.268 |
---|
| 19 | +++ gcc/gcc/reload.c 2005/04/20 14:30:38 1.269 |
---|
| 20 | @@ -1520,7 +1520,7 @@ |
---|
| 21 | But if there is no spilling in this block, that is OK. |
---|
| 22 | An explicitly used hard reg cannot be a spill reg. */ |
---|
| 23 | |
---|
| 24 | - if (rld[i].reg_rtx == 0 && in != 0) |
---|
| 25 | + if (rld[i].reg_rtx == 0 && in != 0 && hard_regs_live_known) |
---|
| 26 | { |
---|
| 27 | rtx note; |
---|
| 28 | int regno; |
---|
| 29 | @@ -1534,6 +1534,11 @@ |
---|
| 30 | && REG_P (XEXP (note, 0)) |
---|
| 31 | && (regno = REGNO (XEXP (note, 0))) < FIRST_PSEUDO_REGISTER |
---|
| 32 | && reg_mentioned_p (XEXP (note, 0), in) |
---|
| 33 | + /* Check that we don't use a hardreg for an uninitialized |
---|
| 34 | + pseudo. See also find_dummy_reload(). */ |
---|
| 35 | + && (ORIGINAL_REGNO (XEXP (note, 0)) < FIRST_PSEUDO_REGISTER |
---|
| 36 | + || ! bitmap_bit_p (ENTRY_BLOCK_PTR->global_live_at_end, |
---|
| 37 | + ORIGINAL_REGNO (XEXP (note, 0)))) |
---|
| 38 | && ! refers_to_regno_for_reload_p (regno, |
---|
| 39 | (regno |
---|
| 40 | + hard_regno_nregs[regno] |
---|
| 41 | @@ -1997,7 +2002,17 @@ |
---|
| 42 | is a subreg, and in that case, out |
---|
| 43 | has a real mode. */ |
---|
| 44 | (GET_MODE (out) != VOIDmode |
---|
| 45 | - ? GET_MODE (out) : outmode))) |
---|
| 46 | + ? GET_MODE (out) : outmode)) |
---|
| 47 | + /* But only do all this if we can be sure, that this input |
---|
| 48 | + operand doesn't correspond with an uninitialized pseudoreg. |
---|
| 49 | + global can assign some hardreg to it, which is the same as |
---|
| 50 | + a different pseudo also currently live (as it can ignore the |
---|
| 51 | + conflict). So we never must introduce writes to such hardregs, |
---|
| 52 | + as they would clobber the other live pseudo using the same. |
---|
| 53 | + See also PR20973. */ |
---|
| 54 | + && (ORIGINAL_REGNO (in) < FIRST_PSEUDO_REGISTER |
---|
| 55 | + || ! bitmap_bit_p (ENTRY_BLOCK_PTR->global_live_at_end, |
---|
| 56 | + ORIGINAL_REGNO (in)))) |
---|
| 57 | { |
---|
| 58 | unsigned int regno = REGNO (in) + in_offset; |
---|
| 59 | unsigned int nwords = hard_regno_nregs[regno][inmode]; |
---|