aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/darwin.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2007-09-06 21:41:33 +0200
committerAndreas Tobler <andreast@gcc.gnu.org>2007-09-06 21:41:33 +0200
commitbc211e05e3379205a808c2f2fa050ba6cc03cf22 (patch)
tree3de702eec913c0413cf93a9a0129a24847a2f726 /gcc/config/darwin.c
parent3cc50edcc07024dd3d34067654794a45f21dd408 (diff)
downloadgcc-bc211e05e3379205a808c2f2fa050ba6cc03cf22.zip
gcc-bc211e05e3379205a808c2f2fa050ba6cc03cf22.tar.gz
gcc-bc211e05e3379205a808c2f2fa050ba6cc03cf22.tar.bz2
darwin.c (machopic_indirect_data_reference): Avoid invalid sharing.
2007-09-06 Jan Hubicka <jh@suse.cz> Andreas Tobler <a.tobler@schweiz.org> * config/darwin.c (machopic_indirect_data_reference): Avoid invalid sharing. (machopic_legitimize_pic_address): Likewise. Co-Authored-By: Andreas Tobler <a.tobler@schweiz.org> From-SVN: r128207
Diffstat (limited to 'gcc/config/darwin.c')
-rw-r--r--gcc/config/darwin.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 92ffb82..d251474 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -542,7 +542,8 @@ machopic_indirect_data_reference (rtx orig, rtx reg)
gen_rtx_PLUS (Pmode, pic_offset_table_rtx,
gen_rtx_HIGH (Pmode, offset))));
emit_insn (gen_rtx_SET (Pmode, reg,
- gen_rtx_LO_SUM (Pmode, hi_sum_reg, offset)));
+ gen_rtx_LO_SUM (Pmode, hi_sum_reg,
+ copy_rtx (offset))));
orig = reg;
#else
@@ -552,7 +553,8 @@ machopic_indirect_data_reference (rtx orig, rtx reg)
emit_insn (gen_rtx_SET (VOIDmode, reg,
gen_rtx_HIGH (Pmode, offset)));
emit_insn (gen_rtx_SET (VOIDmode, reg,
- gen_rtx_LO_SUM (Pmode, reg, offset)));
+ gen_rtx_LO_SUM (Pmode, reg,
+ copy_rtx (offset))));
emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
orig = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, reg);
@@ -714,7 +716,8 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
emit_insn (gen_macho_high (temp_reg, asym));
mem = gen_const_mem (GET_MODE (orig),
- gen_rtx_LO_SUM (Pmode, temp_reg, asym));
+ gen_rtx_LO_SUM (Pmode, temp_reg,
+ copy_rtx (asym)));
emit_insn (gen_rtx_SET (VOIDmode, reg, mem));
#else
/* Some other CPU -- WriteMe! but right now there are no other
@@ -746,7 +749,8 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
mem = gen_const_mem (GET_MODE (orig),
gen_rtx_LO_SUM (Pmode,
- hi_sum_reg, offset));
+ hi_sum_reg,
+ copy_rtx (offset)));
insn = emit_insn (gen_rtx_SET (VOIDmode, reg, mem));
set_unique_reg_note (insn, REG_EQUAL, pic_ref);
@@ -762,7 +766,8 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
offset))));
emit_insn (gen_rtx_SET (VOIDmode, reg,
gen_rtx_LO_SUM (Pmode, reg,
- gen_rtx_CONST (Pmode, offset))));
+ gen_rtx_CONST (Pmode,
+ copy_rtx (offset)))));
pic_ref = gen_rtx_PLUS (Pmode,
pic_offset_table_rtx, reg);
#endif
@@ -822,13 +827,15 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
offset))));
emit_insn (gen_rtx_SET (VOIDmode, reg,
gen_rtx_LO_SUM (Pmode,
- hi_sum_reg, offset)));
+ hi_sum_reg,
+ copy_rtx (offset))));
pic_ref = reg;
#else
emit_insn (gen_rtx_SET (VOIDmode, reg,
gen_rtx_HIGH (Pmode, offset)));
emit_insn (gen_rtx_SET (VOIDmode, reg,
- gen_rtx_LO_SUM (Pmode, reg, offset)));
+ gen_rtx_LO_SUM (Pmode, reg,
+ copy_rtx (offset))));
pic_ref = gen_rtx_PLUS (Pmode,
pic_offset_table_rtx, reg);
#endif