From d089c226364974841aa15eb1da2debaaa5128acc Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sun, 26 Jul 1998 00:35:12 +0000 Subject: [PATCH] i386.h (CONST_DOUBLE_OK_FOR_LETTER_P): Return 0 when eliminating the frame pointer and compiling PIC code and reload... * i386.h (CONST_DOUBLE_OK_FOR_LETTER_P): Return 0 when eliminating the frame pointer and compiling PIC code and reload has not completed. From-SVN: r21393 --- gcc/ChangeLog | 3 +++ gcc/config/i386/i386.h | 13 +++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 85d36f68cafc..7517d2f42df8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ Sun Jul 26 01:11:12 1998 H.J. Lu (hjl@gnu.org) + * i386.h (CONST_DOUBLE_OK_FOR_LETTER_P): Return 0 when eliminating + the frame pointer and compiling PIC code and reload has not completed. + * i386.c (output_to_reg): Add code to emulate non-popping DImode case. diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index a575611e018e..b8fef1148447 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -896,10 +896,19 @@ enum reg_class /* Similar, but for floating constants, and defining letters G and H. Here VALUE is the CONST_DOUBLE rtx itself. We allow constants even if TARGET_387 isn't set, because the stack register converter may need to - load 0.0 into the function value register. */ + load 0.0 into the function value register. + + We disallow these constants when -fomit-frame-pointer and compiling + PIC code since reload might need to force the constant to memory. + Forcing the constant to memory changes the elimination offsets after + the point where they must stay constant. + + However, we must allow them after reload as completed as reg-stack.c + will create insns which use these constants. */ #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ - ((C) == 'G' ? standard_80387_constant_p (VALUE) : 0) + (((reload_completed || !flag_pic || !flag_omit_frame_pointer) && (C) == 'G') \ + ? standard_80387_constant_p (VALUE) : 0) /* Place additional restrictions on the register class to use when it is necessary to be able to hold a value of mode MODE in a reload -- 2.47.2