diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2013-09-16 15:12:22 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2013-09-16 15:12:22 +0000 |
commit | aa940f7c213e4a1378ebf97873089a6becec5015 (patch) | |
tree | 2ba33e8f994c3944d13bd64a5c2feae8cdeefa65 /gcc/lra-constraints.c | |
parent | e645e94288a253da5ba9f14c599378a96348e4ea (diff) | |
download | gcc-aa940f7c213e4a1378ebf97873089a6becec5015.zip gcc-aa940f7c213e4a1378ebf97873089a6becec5015.tar.gz gcc-aa940f7c213e4a1378ebf97873089a6becec5015.tar.bz2 |
re PR middle-end/58418 (wrong code at -O2 and -O3 on x86_64-linux-gnu (in 32-bit mode))
2013-09-16 Vladimir Makarov <vmakarov@redhat.com>
PR middle-end/58418
* lra-constraints.c (undo_optional_reloads): Consider all optional
reload even if it did not get a hard reg.
2013-09-16 Vladimir Makarov <vmakarov@redhat.com>
* gcc.target/i386/pr58418.c: New.
From-SVN: r202630
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r-- | gcc/lra-constraints.c | 69 |
1 files changed, 34 insertions, 35 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 479d2cb..b949a6b 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -5454,43 +5454,42 @@ undo_optional_reloads (void) bitmap_initialize (&removed_optional_reload_pseudos, ®_obstack); bitmap_copy (&removed_optional_reload_pseudos, &lra_optional_reload_pseudos); EXECUTE_IF_SET_IN_BITMAP (&lra_optional_reload_pseudos, 0, regno, bi) - if (reg_renumber[regno] >= 0) - { - keep_p = false; - if (reg_renumber[lra_reg_info[regno].restore_regno] >= 0) - /* If the original pseudo changed its allocation, just - removing the optional pseudo is dangerous as the original - pseudo will have longer live range. */ - keep_p = true; - else - EXECUTE_IF_SET_IN_BITMAP (&lra_reg_info[regno].insn_bitmap, 0, uid, bi2) - { - insn = lra_insn_recog_data[uid]->insn; - if ((set = single_set (insn)) == NULL_RTX) - continue; - src = SET_SRC (set); - dest = SET_DEST (set); - if (! REG_P (src) || ! REG_P (dest)) - continue; - if (REGNO (dest) == regno - /* Ignore insn for optional reloads itself. */ - && lra_reg_info[regno].restore_regno != (int) REGNO (src) - /* Check only inheritance on last inheritance pass. */ - && (int) REGNO (src) >= new_regno_start - /* Check that the optional reload was inherited. */ - && bitmap_bit_p (&lra_inheritance_pseudos, REGNO (src))) - { - keep_p = true; - break; - } - } - if (keep_p) + { + keep_p = false; + if (reg_renumber[lra_reg_info[regno].restore_regno] >= 0) + /* If the original pseudo changed its allocation, just + removing the optional pseudo is dangerous as the original + pseudo will have longer live range. */ + keep_p = true; + else if (reg_renumber[regno] >= 0) + EXECUTE_IF_SET_IN_BITMAP (&lra_reg_info[regno].insn_bitmap, 0, uid, bi2) { - bitmap_clear_bit (&removed_optional_reload_pseudos, regno); - if (lra_dump_file != NULL) - fprintf (lra_dump_file, "Keep optional reload reg %d\n", regno); + insn = lra_insn_recog_data[uid]->insn; + if ((set = single_set (insn)) == NULL_RTX) + continue; + src = SET_SRC (set); + dest = SET_DEST (set); + if (! REG_P (src) || ! REG_P (dest)) + continue; + if (REGNO (dest) == regno + /* Ignore insn for optional reloads itself. */ + && lra_reg_info[regno].restore_regno != (int) REGNO (src) + /* Check only inheritance on last inheritance pass. */ + && (int) REGNO (src) >= new_regno_start + /* Check that the optional reload was inherited. */ + && bitmap_bit_p (&lra_inheritance_pseudos, REGNO (src))) + { + keep_p = true; + break; + } } - } + if (keep_p) + { + bitmap_clear_bit (&removed_optional_reload_pseudos, regno); + if (lra_dump_file != NULL) + fprintf (lra_dump_file, "Keep optional reload reg %d\n", regno); + } + } change_p = ! bitmap_empty_p (&removed_optional_reload_pseudos); bitmap_initialize (&insn_bitmap, ®_obstack); EXECUTE_IF_SET_IN_BITMAP (&removed_optional_reload_pseudos, 0, regno, bi) |