aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Edelsohn <edelsohn@gnu.org>2008-05-09 17:13:30 +0000
committerDavid Edelsohn <edelsohn@gnu.org>2008-05-09 17:13:30 +0000
commit81fb1c328fccb1780b005f86a30ba73cb024a988 (patch)
tree8b9077ade4329127a8ea20d0781ba8d36c73acae
parent9a8ab26ef67743b880eb3bc9a3475622e6e07fcc (diff)
PR target/36090
* config/rs6000/rs6000.c (print_operand_address): If the TOC address RHS contains an offset, output it as well. PR target/36182 Revert: 2008-05-08 Paolo Bonzini <bonzini@gnu.org> PR target/36090 * simplify-rtx.c (simplify_plus_minus): Create CONST of similar RTX_CONST_OBJ before CONST_INT. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_3-branch@135118 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/config/rs6000/rs6000.c4
-rw-r--r--gcc/simplify-rtx.c21
3 files changed, 18 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index dc518defd1f..a70715c4a9a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,16 @@
+2008-05-08 David Edelsohn <edelsohn@gnu.org>
+
+ PR target/36090
+ * config/rs6000/rs6000.c (print_operand_address): If the TOC
+ address RHS contains an offset, output it as well.
+
+ PR target/36182
+ Revert:
+ 2008-05-08 Paolo Bonzini <bonzini@gnu.org>
+ PR target/36090
+ * simplify-rtx.c (simplify_plus_minus): Create CONST of
+ similar RTX_CONST_OBJ before CONST_INT.
+
2008-05-08 H.J. Lu <hongjiu.lu@intel.com>
Backport from mainline:
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 41ed75a0682..1342dd46098 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -12291,6 +12291,10 @@ print_operand_address (FILE *file, rtx x)
XSTR (symref, 0) = newname;
}
output_addr_const (file, XEXP (x, 1));
+ if (GET_CODE (XEXP (minus, 1)) == CONST
+ && (GET_CODE (XEXP (XEXP (minus, 1), 0)) == PLUS))
+ fprintf (file, "+"HOST_WIDE_INT_PRINT_DEC,
+ -INTVAL (XEXP (XEXP (XEXP (minus, 1), 0), 1)));
if (TARGET_ELF)
XSTR (symref, 0) = name;
XEXP (contains_minus, 0) = minus;
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 7b5f2d05285..f8756040ce0 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -3659,26 +3659,7 @@ simplify_plus_minus (enum rtx_code code, enum machine_mode mode, rtx op0,
combination loop to avoid recursion. Create one manually now.
The combination loop should have ensured that there is exactly
one CONST_INT, and the sort will have ensured that it is last
- in the array and that any other constant will be next-to-last.
- Group similar RTX_CONST_OBJ first, then CONST_INT. */
-
- if (GET_CODE (ops[n_ops - 1].op) == CONST_INT)
- i = n_ops - 2;
- else
- i = n_ops - 1;
-
- if (i >= 1
- && ops[i].neg
- && !ops[i - 1].neg
- && CONSTANT_P (ops[i].op)
- && GET_CODE (ops[i].op) == GET_CODE (ops[i - 1].op))
- {
- ops[i - 1].op = gen_rtx_MINUS (mode, ops[i - 1].op, ops[i].op);
- ops[i - 1].op = gen_rtx_CONST (mode, ops[i - 1].op);
- if (i < n_ops - 1)
- ops[i] = ops[i + 1];
- n_ops--;
- }
+ in the array and that any other constant will be next-to-last. */
if (n_ops > 1
&& GET_CODE (ops[n_ops - 1].op) == CONST_INT