]> git.pld-linux.org Git - packages/gcc.git/blame - gcc-pr20249.patch
- updated.
[packages/gcc.git] / gcc-pr20249.patch
CommitLineData
23f617eb
PS
1This patch fixes the problem by preventing the recording of equivalence
2with a register in a different mode.
3
4Bootstrapped & regtested on i686 and ia64 with -fprofile-arcs. I have
5also tried bootstrapping on ppc, this is successful except for a
6bootstrap misscompare (which is a progress, since without the patch
7the bootstrap fails with an ICE similar to the one of the PR). I need
8to check whether the misscompare problem is related to the PR or not.
9
10Zdenek Dvorak
11
12 PR middle-end/20249
13 * cse.c (insert_regs): Do not record equivalence of registers in
14 different modes.
15
16
17--- gcc-4.0-20050312/gcc/cse.c.orig 2005-03-13 15:47:15.000000000 +0100
18+++ gcc-4.0-20050312/gcc/cse.c 2005-03-13 15:49:36.065976704 +0100
19@@ -1234,7 +1234,24 @@
20 if (REG_P (classp->exp)
21 && GET_MODE (classp->exp) == GET_MODE (x))
22 {
23- make_regs_eqv (regno, REGNO (classp->exp));
24+ unsigned c_regno = REGNO (classp->exp);
25+
26+ gcc_assert (REGNO_QTY_VALID_P (c_regno));
27+
28+ /* Suppose that 5 is hard reg and 100 and 101 are
29+ pseudos. Consider
30+
31+ (set (reg:si 100) (reg:si 5))
32+ (set (reg:si 5) (reg:si 100))
33+ (set (reg:di 101) (reg:di 5))
34+
35+ We would now set REG_QTY (101) = REG_QTY (5), but the
36+ entry for 5 is in SImode. When we use this later in
37+ copy propagation, we get the register in wrong mode. */
38+ if (qty_table[REG_QTY (c_regno)].mode != GET_MODE (x))
39+ continue;
40+
41+ make_regs_eqv (regno, c_regno);
42 return 1;
43 }
44
This page took 0.117178 seconds and 4 git commands to generate.