summaryrefslogtreecommitdiff
path: root/gcc/reload1.c
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2001-10-20 15:10:11 +0000
committerHans-Peter Nilsson <hp@gcc.gnu.org>2001-10-20 15:10:11 +0000
commit129c089988b855514665829f645965729099a15b (patch)
treef0126c8d4117026bfc91529a8068ae073ec8a404 /gcc/reload1.c
parent38ca929b576c3122771f5832c49fd6022e6303ea (diff)
downloadgcc-129c089988b855514665829f645965729099a15b.tar.gz
reload1.c (reload): Check CONSTANT_P before calling LEGITIMATE_PIC_OPERAND_P.
* reload1.c (reload): Check CONSTANT_P before calling LEGITIMATE_PIC_OPERAND_P. * config/cris/cris.c (cris_legitimate_pic_operand): Revert workaround of 2001-10-13. From-SVN: r46381
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r--gcc/reload1.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 2be0983a2ac..0b53ac90501 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -778,7 +778,11 @@ reload (first, global)
#ifdef LEGITIMATE_PIC_OPERAND_P
&& (! function_invariant_p (XEXP (note, 0))
|| ! flag_pic
- || LEGITIMATE_PIC_OPERAND_P (XEXP (note, 0)))
+ /* A function invariant is often CONSTANT_P but may
+ include a register. We promise to only pass
+ CONSTANT_P objects to LEGITIMATE_PIC_OPERAND_P. */
+ || (CONSTANT_P (XEXP (note, 0))
+ && LEGITIMATE_PIC_OPERAND_P (XEXP (note, 0))))
#endif
)
{