aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/pa
diff options
context:
space:
mode:
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>2008-02-09 20:34:47 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2008-02-09 20:34:47 +0000
commit4d811a05ed7025e90f2ef533b7069f09885eaa4c (patch)
tree4b39335178945b93061c18c9f161ec90dbc8061c /gcc/config/pa
parenta3395528c116add2192946330529e49ec6c2eb5b (diff)
downloadgcc-4d811a05ed7025e90f2ef533b7069f09885eaa4c.zip
gcc-4d811a05ed7025e90f2ef533b7069f09885eaa4c.tar.gz
gcc-4d811a05ed7025e90f2ef533b7069f09885eaa4c.tar.bz2
PR middle_end/34150
* pa.c (legitimize_pic_address): Add REG_EQUAL note on sets with a pic_label_operand source. Similarly, add a REG_LABEL_OPERAND note and update LABEL_NUSES during and after reload. From-SVN: r132203
Diffstat (limited to 'gcc/config/pa')
-rw-r--r--gcc/config/pa/pa.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index c571a75..c270e4b 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -668,6 +668,8 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
/* Labels need special handling. */
if (pic_label_operand (orig, mode))
{
+ rtx insn;
+
/* We do not want to go through the movXX expanders here since that
would create recursion.
@@ -678,7 +680,24 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
So instead we just emit the raw set, which avoids the movXX
expanders completely. */
mark_reg_pointer (reg, BITS_PER_UNIT);
- emit_insn (gen_rtx_SET (VOIDmode, reg, orig));
+ insn = emit_insn (gen_rtx_SET (VOIDmode, reg, orig));
+
+ /* Put a REG_EQUAL note on this insn, so that it can be optimized. */
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, orig, REG_NOTES (insn));
+
+ /* During and after reload, we need to generate a REG_LABEL_OPERAND note
+ and update LABEL_NUSES because this is not done automatically. */
+ if (reload_in_progress || reload_completed)
+ {
+ /* Extract LABEL_REF. */
+ if (GET_CODE (orig) == CONST)
+ orig = XEXP (XEXP (orig, 0), 0);
+ /* Extract CODE_LABEL. */
+ orig = XEXP (orig, 0);
+ REG_NOTES (insn) = gen_rtx_INSN_LIST (REG_LABEL_OPERAND, orig,
+ REG_NOTES (insn));
+ LABEL_NUSES (orig)++;
+ }
current_function_uses_pic_offset_table = 1;
return reg;
}