aboutsummaryrefslogtreecommitdiff
blob: 54b6f0d9539fbfb6589ae7caca0c89575f5fd3e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
[ganked from debian's gcc-3.3.5-12]

From: Richard Henderson <rth@redhat.com>
Sender: gcc-patches-owner@gcc.gnu.org
To: gcc-patches@gcc.gnu.org
Subject: fix rtl-opt/10692
Date: Wed, 5 Jan 2005 20:17:07 -0800

Kudos to Roman for some excellent diagnosis.

As seen in the dumps in comment 13, note that reg 277 is used twice.
This is what promoted reload 0 to RELOAD_OTHER.  When that happens,
we don't have a record of all the locations within the insn that 
reference the data.

Which means that the pitiful amount of life analysis that happens
within this if conditional is insufficient.  The only simple, and
therefore reliable, solution is to ignore the hard cases entirely.

Bootstrappend and tested on i686-linux, fwiw.  Committed to 3.4/4.0.


r~

# DP: 2005-01-05  Richard Henderson  <rth@redhat.com>
# DP: 
# DP:         PR rtl-opt/10692
# DP:         * reload1.c (do_input_reload): Restrict the optimization deleteing
# DP:         a previous output reload to RELOAD_FOR_INPUT.


*** a/gcc/reload1.c	23 Dec 2004 04:53:48 -0000	1.456
--- b/gcc/reload1.c	6 Jan 2005 04:05:46 -0000
*************** do_input_reload (struct insn_chain *chai
*** 6822,6827 ****
--- 6822,6831 ----
       actually no need to store the old value in it.  */
  
    if (optimize
+       /* Only attempt this for input reloads; for RELOAD_OTHER we miss
+ 	 that there may be multiple uses of the previous output reload.
+ 	 Restricting to RELOAD_FOR_INPUT is mostly paranoia.  */
+       && rl->when_needed == RELOAD_FOR_INPUT
        && (reload_inherited[j] || reload_override_in[j])
        && rl->reg_rtx
        && REG_P (rl->reg_rtx)