aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@gcc.gnu.org>2004-03-16 09:22:36 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2004-03-16 09:22:36 +0000
commit4e7edcca305b9121c314ca5762dc45e426c20065 (patch)
treeaa18b72a10946f018b0da63596169d5b363804bb /gcc
parent3704aae954e07db1b797e5cc1750bcf4f2a88cc1 (diff)
downloadgcc-4e7edcca305b9121c314ca5762dc45e426c20065.zip
gcc-4e7edcca305b9121c314ca5762dc45e426c20065.tar.gz
gcc-4e7edcca305b9121c314ca5762dc45e426c20065.tar.bz2
re PR target/14599 (ieee/20000320-1.c fails for -mips16 using -O2 and above)
PR target/14599 * config/mips/mips.md (UNSPEC_GP): New constant. * config/mips/mips.c (CONST_GP_P): Expect the CONST to contain an UNSPEC instead of (reg $gp). (mips16_gp_pseudo_reg): Change accordingly. (print_operand): Print $gp directly when handling CONST_GP_P. From-SVN: r79527
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/config/mips/mips.c16
-rw-r--r--gcc/config/mips/mips.md1
3 files changed, 21 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b5f6e95..e56a4a9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,9 +1,18 @@
-2004-03-16 Richard Zidlicky <rz@linux-m68k.org>
+2004-03-16 Richard Sandiford <rsandifo@redhat.com>
+
+ PR target/14599
+ * config/mips/mips.md (UNSPEC_GP): New constant.
+ * config/mips/mips.c (CONST_GP_P): Expect the CONST to contain
+ an UNSPEC instead of (reg $gp).
+ (mips16_gp_pseudo_reg): Change accordingly.
+ (print_operand): Print $gp directly when handling CONST_GP_P.
+
+2004-03-16 Richard Zidlicky <rz@linux-m68k.org>
* config.gcc, config/m68k/linux.h: Implement with-cpu for m68k-linux.
* longlong.h: Make code 68060 clean when compiling for m68060.
-2004-03-16 Richard Zidlicky <rz@linux-m68k.org>
+2004-03-16 Richard Zidlicky <rz@linux-m68k.org>
* config/m68k/m68k.md: Fix constraints for bitfield instructions.
* doc/md.texi: Clarify description of "i" constraint.
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index bedf920..c11a659 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -87,10 +87,12 @@ enum internal_test {
#define UNSPEC_ADDRESS_TYPE(X) \
((enum mips_symbol_type) (XINT (X, 1) - UNSPEC_ADDRESS_FIRST))
-/* True if X is (const $gp). This is used to initialize the mips16
- gp pseudo register. */
+/* True if X is (const (unspec [(const_int 0)] UNSPEC_GP)). This is used
+ to initialize the mips16 gp pseudo register. */
#define CONST_GP_P(X) \
- (GET_CODE (X) == CONST && XEXP (X, 0) == pic_offset_table_rtx)
+ (GET_CODE (X) == CONST \
+ && GET_CODE (XEXP (X, 0)) == UNSPEC \
+ && XINT (XEXP (X, 0), 1) == UNSPEC_GP)
/* The maximum distance between the top of the stack frame and the
value $sp has when we save & restore registers.
@@ -5564,7 +5566,7 @@ print_operand (FILE *file, rtx op, int letter)
fputs (code == EQ ? "t" : "f", file);
else if (CONST_GP_P (op))
- print_operand (file, XEXP (op, 0), letter);
+ fputs (reg_names[GLOBAL_POINTER_REGNUM], file);
else
output_addr_const (file, op);
@@ -7799,7 +7801,7 @@ mips16_gp_pseudo_reg (void)
{
if (cfun->machine->mips16_gp_pseudo_rtx == NULL_RTX)
{
- rtx const_gp;
+ rtx unspec;
rtx insn, scan;
cfun->machine->mips16_gp_pseudo_rtx = gen_reg_rtx (Pmode);
@@ -7807,10 +7809,10 @@ mips16_gp_pseudo_reg (void)
/* We want to initialize this to a value which gcc will believe
is constant. */
- const_gp = gen_rtx_CONST (Pmode, pic_offset_table_rtx);
start_sequence ();
+ unspec = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, const0_rtx), UNSPEC_GP);
emit_move_insn (cfun->machine->mips16_gp_pseudo_rtx,
- const_gp);
+ gen_rtx_CONST (Pmode, unspec));
insn = get_insns ();
end_sequence ();
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 189b59b..5b3c846 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -56,6 +56,7 @@
(UNSPEC_LOADGP 26)
(UNSPEC_LOAD_CALL 27)
(UNSPEC_LOAD_GOT 28)
+ (UNSPEC_GP 29)
(UNSPEC_ADDRESS_FIRST 100)