source: scripts/patches/gcc-4.0.0-reload_check_uninitialized_pseudos_PR20973.patch@ de4db44

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since de4db44 was 7f65c0e, checked in by Jim Gifford <clfs@…>, 19 years ago

r625@server (orig r623): jim | 2005-10-31 12:43:24 -0800
Final Move

  • Property mode set to 100644
File size: 2.3 KB
RevLine 
[617118d]1Submitted by: Ryan Oliver <ryan.oliver@pha.com.au>
2Source: http://gcc.gnu.org/ml/gcc-cvs/2005-04/msg01085.html
3Initial Package Version: 4.0.0
4Upstream Status: In gcc4 mainline
5Description:
6
72005-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===================================================================
14RCS file: /cvs/gcc/gcc/gcc/reload.c,v
15retrieving revision 1.268
16retrieving revision 1.269
17diff -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];
Note: See TracBrowser for help on using the repository browser.