aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-07-26 08:03:31 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-07-26 08:03:31 -0400
commit56cbbbd71726c8e018202b8b6a163c0187948a58 (patch)
tree4d62b4c9fb0b6716d892811da1902ec77f4f08a6 /gcc
parent03c424843cc9eb0926235db1de7a113ddd965fda (diff)
downloadgcc-56cbbbd71726c8e018202b8b6a163c0187948a58.zip
gcc-56cbbbd71726c8e018202b8b6a163c0187948a58.tar.gz
gcc-56cbbbd71726c8e018202b8b6a163c0187948a58.tar.bz2
(LEGITIMATE_PIC_OPERAND_P): Reject CONST_DOUBLE with MEM with invalid
pic address. From-SVN: r10156
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/m68k/hp320.h10
-rw-r--r--gcc/config/m68k/m68k.h5
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/config/m68k/hp320.h b/gcc/config/m68k/hp320.h
index a00917d..f748f3f 100644
--- a/gcc/config/m68k/hp320.h
+++ b/gcc/config/m68k/hp320.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler. HP-UX 68000/68020 version.
- Copyright (C) 1987, 1988, 1993, 1994 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1988, 1993, 1994, 1995 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -595,12 +595,16 @@ do { register int i; \
(LABEL_NO));
#endif /* not HPUX_ASM */
+
/* In m68k svr4, a symbol_ref rtx can be a valid PIC operand if it is an
operand of a function call. */
#undef LEGITIMATE_PIC_OPERAND_P
#define LEGITIMATE_PIC_OPERAND_P(X) \
- (! symbolic_operand (X, VOIDmode) \
- || ((GET_CODE(X) == SYMBOL_REF) && SYMBOL_REF_FLAG(X)))
+ ((! symbolic_operand (X, VOIDmode) \
+ && ! (GET_CODE (X) == CONST_DOUBLE && CONST_DOUBLE_MEM (X) \
+ && GET_CODE (CONST_DOUBLE_MEM (X)) == MEM \
+ && symbolic_operand (XEXP (CONST_DOUBLE_MEM (X), 0), VOIDmode))) \
+ || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)))
/* hpux8 and later have C++ compatible include files, so do not
pretend they are `extern "C"'. */
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index 5f26800..e54bee3 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -1080,7 +1080,10 @@ __transfer_from_trampoline () \
that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
#define LEGITIMATE_PIC_OPERAND_P(X) \
- (! symbolic_operand (X, VOIDmode))
+ (! symbolic_operand (X, VOIDmode) \
+ && ! (GET_CODE (X) == CONST_DOUBLE && CONST_DOUBLE_MEM (X) \
+ && GET_CODE (CONST_DOUBLE_MEM (X)) == MEM \
+ && symbolic_operand (XEXP (CONST_DOUBLE_MEM (X), 0), VOIDmode)))
/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
and check its validity for a certain class.