public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Problem on i386 with -fpic -fomit-frame-pointer
@ 1998-08-28  5:22 Bernd Schmidt
  1998-10-08 11:45 ` Jeffrey A Law
  0 siblings, 1 reply; 12+ messages in thread
From: Bernd Schmidt @ 1998-08-28  5:22 UTC (permalink / raw)
  To: egcs; +Cc: hjl

With the reload patch I sent in on Monday, gcc miscompiled the file e_hypotl.c
from glibc-2.0.95. The problem appears to be in i386.md, in the mov[sdx]f
patterns. I believe the following change is incomplete:

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.

If using -fomit-frame-pointer together with -fPIC, this will not accept any
floating point constants, and reload will substitute memory references for
them.  However, the expander patterns have not been updated together with
this patch, they still assume that certain constants are valid.  The result
was that in the file that was miscompiled, a load instruction using the PIC
register was emitted, but during reload the variable
current_function_uses_pic_offset_table remains set to zero. This causes
incorrect register elimination offsets, which in turn causes some of the
generated store instructions to write data outside the stack frame and
clobber one of the callee-saved registers.

Bernd


	* i386.md (movsf, movdf, movxf): Accept no constants if -fPIC and
	-fomit-frame-pointer.

diff -u -r1.1.1.28 i386.md
--- i386.md	1998/08/05 12:00:31	1.1.1.28
+++ i386.md	1998/08/28 10:07:09
@@ -1230,14 +1230,15 @@
       operands[1] = force_reg (SFmode, operands[1]);
     }
 
-  /* If we are loading a floating point constant that isn't 0 or 1
-     into a register, indicate we need the pic register loaded.  This could
-     be optimized into stores of constants if the target eventually moves
-     to memory, but better safe than sorry.  */
+  /* If we are loading a floating point constant that isn't 0 or 1 into a
+     register, indicate we need the pic register loaded.  This could be
+     optimized into stores of constants if the target eventually moves to
+     memory, but better safe than sorry.  */
   else if ((reload_in_progress | reload_completed) == 0
       && GET_CODE (operands[0]) != MEM
       && GET_CODE (operands[1]) == CONST_DOUBLE
-      && !standard_80387_constant_p (operands[1]))
+      && ((flag_pic && flag_omit_frame_pointer)
+	  || ! standard_80387_constant_p (operands[1])))
     {
       rtx insn, note, fp_const;
 
@@ -1385,7 +1386,8 @@
   else if ((reload_in_progress | reload_completed) == 0
       && GET_CODE (operands[0]) != MEM
       && GET_CODE (operands[1]) == CONST_DOUBLE
-      && !standard_80387_constant_p (operands[1]))
+      && ((flag_pic && flag_omit_frame_pointer)
+	  || ! standard_80387_constant_p (operands[1])))
     {
       rtx insn, note, fp_const;
 
@@ -1527,14 +1529,15 @@
       operands[1] = force_reg (XFmode, operands[1]);
     }
 
-  /* If we are loading a floating point constant that isn't 0 or 1
-     into a register, indicate we need the pic register loaded.  This could
-     be optimized into stores of constants if the target eventually moves
-     to memory, but better safe than sorry.  */
+  /* If we are loading a floating point constant that isn't 0 or 1 into a
+     register, indicate we need the pic register loaded.  This could be
+     optimized into stores of constants if the target eventually moves to
+     memory, but better safe than sorry.  */
   else if ((reload_in_progress | reload_completed) == 0
       && GET_CODE (operands[0]) != MEM
       && GET_CODE (operands[1]) == CONST_DOUBLE
-      && !standard_80387_constant_p (operands[1]))
+      && ((flag_pic && flag_omit_frame_pointer)
+	  || ! standard_80387_constant_p (operands[1])))
     {
       rtx insn, note, fp_const;
 


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem on i386 with -fpic -fomit-frame-pointer
  1998-08-28  5:22 Problem on i386 with -fpic -fomit-frame-pointer Bernd Schmidt
@ 1998-10-08 11:45 ` Jeffrey A Law
  1998-10-08 12:10   ` Bernd Schmidt
  1998-10-08 21:41   ` Richard Henderson
  0 siblings, 2 replies; 12+ messages in thread
From: Jeffrey A Law @ 1998-10-08 11:45 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: egcs, hjl

  In message <Pine.GSO.4.02A.9808281343230.8679-100000@matlock.informatik.rwth-
aachen.de>you write:
  > With the reload patch I sent in on Monday, gcc miscompiled the file e_hypot
  > l.c
  > from glibc-2.0.95. The problem appears to be in i386.md, in the mov[sdx]f
  > patterns. I believe the following change is incomplete:
  > 
  > 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 complet
  > ed.
  > 
  > If using -fomit-frame-pointer together with -fPIC, this will not accept any
  > floating point constants, and reload will substitute memory references for
  > them.  However, the expander patterns have not been updated together with
  > this patch, they still assume that certain constants are valid.  The result
  > was that in the file that was miscompiled, a load instruction using the PIC
  > register was emitted, but during reload the variable
  > current_function_uses_pic_offset_table remains set to zero. This causes
  > incorrect register elimination offsets, which in turn causes some of the
  > generated store instructions to write data outside the stack frame and
  > clobber one of the callee-saved registers.
  > 
  > Bernd
  > 
  > 
  > 	* i386.md (movsf, movdf, movxf): Accept no constants if -fPIC and
  > 	-fomit-frame-pointer.
Did this problem get fixed?  I know rth did some work on the movsf, movdf and
movxf patterns for the x86, but I don't know if they were supposed to solve
this problem or not.

jeff

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem on i386 with -fpic -fomit-frame-pointer
  1998-10-08 11:45 ` Jeffrey A Law
@ 1998-10-08 12:10   ` Bernd Schmidt
  1998-10-08 13:13     ` H.J. Lu
  1998-10-11  0:26     ` Jeffrey A Law
  1998-10-08 21:41   ` Richard Henderson
  1 sibling, 2 replies; 12+ messages in thread
From: Bernd Schmidt @ 1998-10-08 12:10 UTC (permalink / raw)
  To: Jeffrey A Law; +Cc: egcs, hjl

>   > With the reload patch I sent in on Monday, gcc miscompiled the file e_hypot
>   > l.c
>   > from glibc-2.0.95. The problem appears to be in i386.md, in the mov[sdx]f
>   > patterns. I believe the following change is incomplete:
>   > 
>   > 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 complet
>   > ed.
>   > 
>   > If using -fomit-frame-pointer together with -fPIC, this will not accept any
>   > floating point constants, and reload will substitute memory references for
>   > them.  However, the expander patterns have not been updated together with
>   > this patch, they still assume that certain constants are valid.  The result
>   > was that in the file that was miscompiled, a load instruction using the PIC
>   > register was emitted, but during reload the variable
>   > current_function_uses_pic_offset_table remains set to zero. This causes
>   > incorrect register elimination offsets, which in turn causes some of the
>   > generated store instructions to write data outside the stack frame and
>   > clobber one of the callee-saved registers.
>   > 
>   > Bernd
>   > 
>   > 
>   > 	* i386.md (movsf, movdf, movxf): Accept no constants if -fPIC and
>   > 	-fomit-frame-pointer.
> Did this problem get fixed?  I know rth did some work on the movsf, movdf and
> movxf patterns for the x86, but I don't know if they were supposed to solve
> this problem or not.

I'm not entirely certain about what is going on.  We are definitely having
some weird problems still.  First of all, I'd like to see the original test
case that led to the Jul 26 change, if someone still has it.

These are the current definitions which are relevant to the issue.  HJ's
change modified CONST_DOUBLE_OK_FOR_LETTER_P, and was followed by
several changes by Richard Henderson and me in PREFERRED_RELOAD_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.

   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)  \
  (((reload_completed || !flag_pic || !flag_omit_frame_pointer) && (C) == 'G') \
   ? standard_80387_constant_p (VALUE) : 0)

/* Given an rtx X being reloaded into a reg required to be
   in class CLASS, return the class of reg to actually use.
   In general this is just CLASS; but on some machines
   in some cases it is preferable to use a more restrictive class.
   On the 80386 series, we prevent floating constants from being
   reloaded into floating registers (since no move-insn can do that)
   and we ensure that QImodes aren't reloaded into the esi or edi reg.  */

/* Put float CONST_DOUBLE in the constant pool instead of fp regs.
   QImode must go into class Q_REGS.
   Narrow ALL_REGS to GENERAL_REGS.  This supports allowing movsf and
   movdf to do mem-to-mem moves through integer regs. */

#define PREFERRED_RELOAD_CLASS(X,CLASS)					\
  (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != VOIDmode		\
   ? (standard_80387_constant_p (X)					\
      ? reg_class_subset_p (CLASS, FLOAT_REGS) ? CLASS : FLOAT_REGS	\
      : NO_REGS)							\
   : GET_MODE (X) == QImode && ! reg_class_subset_p (CLASS, Q_REGS) ? Q_REGS \
   : ((CLASS) == ALL_REGS						\
      && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) ? GENERAL_REGS	\
   : (CLASS))
============

We are currently having problems with the code in reload1.c that checks
reload insns which were emitted for asm statements for validity.  The
CONST_DOUBLE_OK_FOR_LETTER_P macro will reject standard 387 constants at
the time, because reload_completed is still zero, and we'll abort
occasionally for (perfectly valid) reload insns which load constant
values into a FLOAT_REG.  These didn't occur previously, presumably
because until recently, PREFERRED_RELOAD_CLASS returned VOIDmode for all
CONST_DOUBLES.
That we're now creating such insns might in fact be good news, because
that means we might be able to undo HJ's change: if reload no longer
needs to put standard 387 constants into the constant pool, the original
motivation for the change is probably gone.  But I'm not sure, since I
don't have the original test case.

Bernd

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem on i386 with -fpic -fomit-frame-pointer
  1998-10-08 12:10   ` Bernd Schmidt
@ 1998-10-08 13:13     ` H.J. Lu
  1998-10-11  0:26     ` Jeffrey A Law
  1 sibling, 0 replies; 12+ messages in thread
From: H.J. Lu @ 1998-10-08 13:13 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: law, egcs

> > Did this problem get fixed?  I know rth did some work on the movsf, movdf and
> > movxf patterns for the x86, but I don't know if they were supposed to solve
> > this problem or not.
> 
> I'm not entirely certain about what is going on.  We are definitely having
> some weird problems still.  First of all, I'd like to see the original test
> case that led to the Jul 26 change, if someone still has it.
> 

I am enclosing a mail archive with 3 message inside. You can find
more on that topic from the egcs mailing list archive. Just check
for topics with "-fpic -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H=3LH=3LH=3LH=1L_U*S
254T`/P%+:P+^"WNSU1MO3P``
`
end

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem on i386 with -fpic -fomit-frame-pointer
  1998-10-08 21:41   ` Richard Henderson
@ 1998-10-08 21:41     ` Jeffrey A Law
  0 siblings, 0 replies; 12+ messages in thread
From: Jeffrey A Law @ 1998-10-08 21:41 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Bernd Schmidt, egcs, hjl

  In message < 19981008213426.B13335@dot.cygnus.com >you write:
  > I think CONST_DOUBLE_OK_FOR_LETTER_P is probably wrong.  One of the
  > problems I'd fixed during the mov*f changes was to correct the fact
  > that PREFERRED_RELOAD_CLASS for those special constants was NO_REGS,
  > which was what was causing reload to drop things to memory in the
  > first place.  
  > 
  > Which was the offending file?  e_hypot.c?
e_hypotl.c according to Bernd's message.

jeff

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem on i386 with -fpic -fomit-frame-pointer
  1998-10-08 11:45 ` Jeffrey A Law
  1998-10-08 12:10   ` Bernd Schmidt
@ 1998-10-08 21:41   ` Richard Henderson
  1998-10-08 21:41     ` Jeffrey A Law
  1 sibling, 1 reply; 12+ messages in thread
From: Richard Henderson @ 1998-10-08 21:41 UTC (permalink / raw)
  To: law, Bernd Schmidt; +Cc: egcs, hjl

On Thu, Oct 08, 1998 at 06:14:19AM -0600, Jeffrey A Law wrote:
>   >  * i386.h (CONST_DOUBLE_OK_FOR_LETTER_P): Return 0 when eliminating
>   >  the frame pointer and compiling PIC code and reload has not completed.
> Did this problem get fixed?  I know rth did some work on the movsf, movdf and
> movxf patterns for the x86, but I don't know if they were supposed to solve
> this problem or not.

I think CONST_DOUBLE_OK_FOR_LETTER_P is probably wrong.  One of the
problems I'd fixed during the mov*f changes was to correct the fact
that PREFERRED_RELOAD_CLASS for those special constants was NO_REGS,
which was what was causing reload to drop things to memory in the
first place.  

Which was the offending file?  e_hypot.c?


r~

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem on i386 with -fpic -fomit-frame-pointer
  1998-10-08 12:10   ` Bernd Schmidt
  1998-10-08 13:13     ` H.J. Lu
@ 1998-10-11  0:26     ` Jeffrey A Law
  1998-10-13 19:22       ` Richard Henderson
  1 sibling, 1 reply; 12+ messages in thread
From: Jeffrey A Law @ 1998-10-11  0:26 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: egcs, hjl

  In message <Pine.SOL.3.90.981008144357.2965E-100000@matula.informatik.rwth-aa
chen.de>you write:
  > I'm not entirely certain about what is going on.  We are definitely having
  > some weird problems still.  First of all, I'd like to see the original test
  > case that led to the Jul 26 change, if someone still has it.
http://www.cygnus.com/ml/egcs-bugs/1998-Jun/0345.html

There are random messages about this bug in egcs, egcs-bugs and egcs-patches
in June and July.

  > That we're now creating such insns might in fact be good news, because
  > that means we might be able to undo HJ's change: if reload no longer
  > needs to put standard 387 constants into the constant pool, the original
  > motivation for the change is probably gone.  But I'm not sure, since I
  > don't have the original test case.
I suspect there probably are still cases where reload is going to try to put
those constants in the constant pool.

That's generally what reload does with a constant when it gets confused.  It
just drops it into memory and loads it into an appropriate register.

jeff

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem on i386 with -fpic -fomit-frame-pointer
  1998-10-11  0:26     ` Jeffrey A Law
@ 1998-10-13 19:22       ` Richard Henderson
  1998-10-14 18:58         ` Bill Currie
  0 siblings, 1 reply; 12+ messages in thread
From: Richard Henderson @ 1998-10-13 19:22 UTC (permalink / raw)
  To: law, Bernd Schmidt; +Cc: egcs, hjl

On Sun, Oct 11, 1998 at 01:24:50AM -0600, Jeffrey A Law wrote:
> I suspect there probably are still cases where reload is going to try to put
> those constants in the constant pool.
> 
> That's generally what reload does with a constant when it gets confused.  It
> just drops it into memory and loads it into an appropriate register.

It shouldn't.  One of the changes Bernd and I iterated on a bit ago
was to get reload to actually emit the instructions that generate
these constants.  And aside from 0.0 and 1.0, everything else should
have been dropped to memory during rtl generation.

A question might be -- if something somewhere is still wrong, or
breaks in the future, how to be sure that reload will abort rather
than silently generate bad code in this instance.


r~

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem on i386 with -fpic -fomit-frame-pointer
  1998-10-13 19:22       ` Richard Henderson
@ 1998-10-14 18:58         ` Bill Currie
  1998-10-14 18:58           ` Richard Henderson
  0 siblings, 1 reply; 12+ messages in thread
From: Bill Currie @ 1998-10-14 18:58 UTC (permalink / raw)
  To: Richard Henderson; +Cc: law, Bernd Schmidt, egcs, hjl

Richard Henderson wrote:
> It shouldn't.  One of the changes Bernd and I iterated on a bit ago
> was to get reload to actually emit the instructions that generate
> these constants.  And aside from 0.0 and 1.0, everything else should
> have been dropped to memory during rtl generation.

What about PI and e (log2(e)?) and any other constants that are
available in hardware?  Yes, I know there's the problem of recognising
them (ie they have to be specified `exactly' (for the representation)). 
I can't remember them all, but I know the Intel FPU has a few other
usefull constants.

Bill
-- 
Leave others their otherness

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem on i386 with -fpic -fomit-frame-pointer
  1998-10-14 18:58         ` Bill Currie
@ 1998-10-14 18:58           ` Richard Henderson
  1998-10-14 21:17             ` Bill Currie
  0 siblings, 1 reply; 12+ messages in thread
From: Richard Henderson @ 1998-10-14 18:58 UTC (permalink / raw)
  To: Bill Currie, Richard Henderson; +Cc: law, Bernd Schmidt, egcs, hjl

On Thu, Oct 15, 1998 at 09:54:29AM +1300, Bill Currie wrote:
> What about PI and e (log2(e)?) and any other constants that are
> available in hardware?

We do not attempt to recognize them, primarily because the
actual fpu constants are long double constants, and would
not be appropriate for substitution for the other precisions.


r~

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem on i386 with -fpic -fomit-frame-pointer
  1998-10-14 18:58           ` Richard Henderson
@ 1998-10-14 21:17             ` Bill Currie
  0 siblings, 0 replies; 12+ messages in thread
From: Bill Currie @ 1998-10-14 21:17 UTC (permalink / raw)
  To: Richard Henderson; +Cc: law, Bernd Schmidt, egcs, hjl

Richard Henderson wrote:
> We do not attempt to recognize them, primarily because the
> actual fpu constants are long double constants, and would
> not be appropriate for substitution for the other precisions.

Fair enough, but isn't M_PI specified as a long double in math.h
(3.14159265358979323846 for Sun).  Wouldn't this cause problems for
either float or double (or long double if I got the size/type of M_PI
wrong)?  If not, where's the error in my thinking?  Or is it a `don't do
that [unless you know what you're doing]' issue (like trying to compare
x==0.1)?

Bill
-- 
Leave others their otherness

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Problem on i386 with -fpic -fomit-frame-pointer
@ 1998-10-15  6:29 N8TM
  0 siblings, 0 replies; 12+ messages in thread
From: N8TM @ 1998-10-15  6:29 UTC (permalink / raw)
  To: bcurrie, rth; +Cc: law, crux, egcs, hjl

In a message dated 10/15/98 2:43:58 AM Pacific Daylight Time,
bcurrie@tssc.co.nz writes:

> What about PI and e (log2(e)?) and any other constants that are
>  available in hardware?  Yes, I know there's the problem of recognising
>  them (ie they have to be specified `exactly' (for the representation)). 
>  I can't remember them all, but I know the Intel FPU has a few other
>  usefull constants.
When I first used gcc, on a Sun 3/60, I modified the constant recognition
function so that it used the internal constant if it was within 1 +-
DBL_EPSILON or FLT_EPSILON, as the case might be, of matching.  Pedantically
speaking, this isn't correct, but I found the results quite satisfactory, as
it was really better to have the occasional boost in precision.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~1998-10-15  6:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-08-28  5:22 Problem on i386 with -fpic -fomit-frame-pointer Bernd Schmidt
1998-10-08 11:45 ` Jeffrey A Law
1998-10-08 12:10   ` Bernd Schmidt
1998-10-08 13:13     ` H.J. Lu
1998-10-11  0:26     ` Jeffrey A Law
1998-10-13 19:22       ` Richard Henderson
1998-10-14 18:58         ` Bill Currie
1998-10-14 18:58           ` Richard Henderson
1998-10-14 21:17             ` Bill Currie
1998-10-08 21:41   ` Richard Henderson
1998-10-08 21:41     ` Jeffrey A Law
1998-10-15  6:29 N8TM

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).