Commit 57d1019b by Richard Henderson

regrename.c (find_oldest_value_reg): Ignore the value chain if the original…

regrename.c (find_oldest_value_reg): Ignore the value chain if the original register was copied in a mode with a...

        * regrename.c (find_oldest_value_reg): Ignore the value chain if
        the original register was copied in a mode with a fewer number of
        hard registers than the desired mode.
        (copyprop_hardreg_forward_1): Likewise.
        (debug_value_data): Fix loop test.
        * toplev.c (parse_options_and_default_flags): Reenable
        -fcprop-registers at -O1.

From-SVN: r48624
parent 70ec0b9b
002-01-07 Aldy Hernandez <aldyh@redhat.com> 2002-01-07 Richard Henderson <rth@redhat.com>
* regrename.c (find_oldest_value_reg): Ignore the value chain if
the original register was copied in a mode with a fewer number of
hard registers than the desired mode.
(copyprop_hardreg_forward_1): Likewise.
(debug_value_data): Fix loop test.
* toplev.c (parse_options_and_default_flags): Reenable
-fcprop-registers at -O1.
2002-01-07 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/rs6000.c (bdesc_2arg): Add altivec predicates. * config/rs6000/rs6000.c (bdesc_2arg): Add altivec predicates.
(altivec_init_builtins): New node v4si_ftype_v16qi_v16qi. (altivec_init_builtins): New node v4si_ftype_v16qi_v16qi.
......
...@@ -1282,6 +1282,20 @@ find_oldest_value_reg (class, reg, vd) ...@@ -1282,6 +1282,20 @@ find_oldest_value_reg (class, reg, vd)
enum machine_mode mode = GET_MODE (reg); enum machine_mode mode = GET_MODE (reg);
unsigned int i; unsigned int i;
/* If we are accessing REG in some mode other that what we set it in,
make sure that the replacement is valid. In particular, consider
(set (reg:DI r11) (...))
(set (reg:SI r9) (reg:SI r11))
(set (reg:SI r10) (...))
(set (...) (reg:DI r9))
Replacing r9 with r11 is invalid. */
if (mode != vd->e[regno].mode)
{
if (HARD_REGNO_NREGS (regno, mode)
> HARD_REGNO_NREGS (regno, vd->e[regno].mode))
return NULL_RTX;
}
for (i = vd->e[regno].oldest_regno; i != regno; i = vd->e[i].next_regno) for (i = vd->e[regno].oldest_regno; i != regno; i = vd->e[i].next_regno)
if (TEST_HARD_REG_BIT (reg_class_contents[class], i) if (TEST_HARD_REG_BIT (reg_class_contents[class], i)
&& (vd->e[i].mode == mode && (vd->e[i].mode == mode
...@@ -1544,6 +1558,15 @@ copyprop_hardreg_forward_1 (bb, vd) ...@@ -1544,6 +1558,15 @@ copyprop_hardreg_forward_1 (bb, vd)
unsigned int i; unsigned int i;
rtx new; rtx new;
/* If we are accessing SRC in some mode other that what we
set it in, make sure that the replacement is valid. */
if (mode != vd->e[regno].mode)
{
if (HARD_REGNO_NREGS (regno, mode)
> HARD_REGNO_NREGS (regno, vd->e[regno].mode))
goto no_move_special_case;
}
/* If the destination is also a register, try to find a source /* If the destination is also a register, try to find a source
register in the same class. */ register in the same class. */
if (REG_P (SET_DEST (set))) if (REG_P (SET_DEST (set)))
...@@ -1578,6 +1601,7 @@ copyprop_hardreg_forward_1 (bb, vd) ...@@ -1578,6 +1601,7 @@ copyprop_hardreg_forward_1 (bb, vd)
} }
} }
} }
no_move_special_case:
/* For each input operand, replace a hard register with the /* For each input operand, replace a hard register with the
eldest live copy that's in an appropriate register class. */ eldest live copy that's in an appropriate register class. */
...@@ -1735,7 +1759,7 @@ debug_value_data (vd) ...@@ -1735,7 +1759,7 @@ debug_value_data (vd)
j != INVALID_REGNUM; j != INVALID_REGNUM;
j = vd->e[j].next_regno) j = vd->e[j].next_regno)
{ {
if (TEST_HARD_REG_BIT (set, vd->e[j].next_regno)) if (TEST_HARD_REG_BIT (set, j))
{ {
fprintf (stderr, "[%u] Loop in regno chain\n", j); fprintf (stderr, "[%u] Loop in regno chain\n", j);
return; return;
......
...@@ -4663,7 +4663,7 @@ parse_options_and_default_flags (argc, argv) ...@@ -4663,7 +4663,7 @@ parse_options_and_default_flags (argc, argv)
flag_omit_frame_pointer = 1; flag_omit_frame_pointer = 1;
#endif #endif
flag_guess_branch_prob = 1; flag_guess_branch_prob = 1;
/* flag_cprop_registers = 1; */ flag_cprop_registers = 1;
} }
if (optimize >= 2) if (optimize >= 2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment