From 129c089988b855514665829f645965729099a15b Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Sat, 20 Oct 2001 15:10:11 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 7 +++++++ gcc/config/cris/cris.c | 6 ------ gcc/reload1.c | 6 +++++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 04f1414538d..984104ddd4d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2001-10-20 Hans-Peter Nilsson + + * 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. + Sat Oct 20 15:16:10 CEST 2001 Jan Hubicka * i386.c (split_di): Handle splitting of DFmode. diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c index 4a9e08d0a9f..668811ee010 100644 --- a/gcc/config/cris/cris.c +++ b/gcc/config/cris/cris.c @@ -2239,12 +2239,6 @@ int cris_legitimate_pic_operand (x) rtx x; { - /* This test is due to a bug in the core of GCC. See - for the - real fix; we shouldn't need to test CONSTANT_P here. */ - if (! CONSTANT_P (x)) - return 0; - /* The PIC representation of a symbol with a GOT entry will be (for example; relocations differ): sym => [rPIC+sym:GOT] 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 ) { -- 2.30.2