diff options
author | Zdenek Dvorak <dvorakz@suse.cz> | 2005-03-25 10:23:47 +0100 |
---|---|---|
committer | Zdenek Dvorak <rakdver@gcc.gnu.org> | 2005-03-25 09:23:47 +0000 |
commit | cd928652255d6203f3223a589fff3eed02995850 (patch) | |
tree | 5709052f755bd164f42d4e1e895f136f0fb36fb2 /gcc/cse.c | |
parent | 256f7136ca968b087047f92cee1c90b72adb0120 (diff) | |
download | gcc-cd928652255d6203f3223a589fff3eed02995850.zip gcc-cd928652255d6203f3223a589fff3eed02995850.tar.gz gcc-cd928652255d6203f3223a589fff3eed02995850.tar.bz2 |
re PR rtl-optimization/20249 (ICE with -fprofile-arcs on ppc)
PR rtl-optimization/20249
* cse.c (insert_regs): Do not record equivalence of registers in
different modes.
* gcc.dg/20050325-1.c: New test.
From-SVN: r97039
Diffstat (limited to 'gcc/cse.c')
-rw-r--r-- | gcc/cse.c | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -1234,7 +1234,24 @@ insert_regs (rtx x, struct table_elt *classp, int modified) if (REG_P (classp->exp) && GET_MODE (classp->exp) == GET_MODE (x)) { - make_regs_eqv (regno, REGNO (classp->exp)); + unsigned c_regno = REGNO (classp->exp); + + gcc_assert (REGNO_QTY_VALID_P (c_regno)); + + /* Suppose that 5 is hard reg and 100 and 101 are + pseudos. Consider + + (set (reg:si 100) (reg:si 5)) + (set (reg:si 5) (reg:si 100)) + (set (reg:di 101) (reg:di 5)) + + We would now set REG_QTY (101) = REG_QTY (5), but the + entry for 5 is in SImode. When we use this later in + copy propagation, we get the register in wrong mode. */ + if (qty_table[REG_QTY (c_regno)].mode != GET_MODE (x)) + continue; + + make_regs_eqv (regno, c_regno); return 1; } |