public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: egcs release
@ 1997-08-29  6:00 H.J. Lu
  0 siblings, 0 replies; 8+ messages in thread
From: H.J. Lu @ 1997-08-29  6:00 UTC (permalink / raw)
  To: egcs

> I have lots of bug reports and patches from you.  It would be helpful if
> you could prioritize them, so I know which ones to work on first.
> 

Thanks. I'd like to see my libio/libstdc++ patches get installed
first.

-- 
H.J. Lu (hjl@gnu.ai.mit.edu)

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

* Re: egcs release
  1997-08-28 20:03 suggested addition to -Wparentheses: warn about ` ! x & 1 ' Jim Meyering
@ 1997-08-28 20:03 ` Jim Wilson
  0 siblings, 0 replies; 8+ messages in thread
From: Jim Wilson @ 1997-08-28 20:03 UTC (permalink / raw)
  To: egcs

	Thanks. I can use egcs compile glibc now. It passed "make check".
	BTW, how about the long long bug in cpp? I have a patch for it.

I have lots of bug reports and patches from you.  It would be helpful if
you could prioritize them, so I know which ones to work on first.

Jim

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

* Re: egcs release
@ 1997-08-28 19:37 H.J. Lu
  0 siblings, 0 replies; 8+ messages in thread
From: H.J. Lu @ 1997-08-28 19:37 UTC (permalink / raw)
  To: egcs

> I suggest we use this patch.  This fixes the testcase that you wrote your
> patch for, and works for both schedulers.
> 
> Wed Aug 27 14:52:54 1997  Jim Wilson  <wilson@cygnus.com>
> 
> 	* i386.c (ix86_expand_epilogue): Emit blockage instruction when pic.
> 

Thanks. I can use egcs compile glibc now. It passed "make check".
BTW, how about the long long bug in cpp? I have a patch for it.


H.J.

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

* Re: egcs release
@ 1997-08-27 22:01 Jim Wilson
  0 siblings, 0 replies; 8+ messages in thread
From: Jim Wilson @ 1997-08-27 22:01 UTC (permalink / raw)
  To: egcs

	Wed Jul 30 14:43:34 1997  H.J. Lu  (hjl@gnu.ai.mit.edu)

		* sched.c (sched_analyze_2): Handle access stack memory
		beyond the stack pointer via the frame pointer.
		(STACK_POINTER_REG_NREGS): New. Default as 1.

We already have a patch installed that fixes this, and which works for
both the old (sched.c) and new (haifa-sched.c) schedulers.  Patches that
only fix sched.c aren't very userful anymore.

	Sun Jul 13 13:39:15 1997  H.J. Lu  (hjl@gnu.ai.mit.edu)

		* sched.c (sched_analyze_2): Handle USE_PIC_OFFSET_TABLE_REG if
		defined.
		(PIC_OFFSET_TABLE_REG_NREGS): New. Default as 1.

		* config/i386/i386.h (USE_PIC_OFFSET_TABLE_REG): New. True if
		the PIC base register is used.

I suggest we use this patch.  This fixes the testcase that you wrote your
patch for, and works for both schedulers.

Wed Aug 27 14:52:54 1997  Jim Wilson  <wilson@cygnus.com>

	* i386.c (ix86_expand_epilogue): Emit blockage instruction when pic.

Index: i386.c
===================================================================
RCS file: /cvs/cvsfiles/egcs/gcc/config/i386/i386.c,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 i386.c
*** i386.c	1997/08/11 15:57:16	1.1.1.1
--- i386.c	1997/08/27 21:52:31
*************** ix86_expand_epilogue ()
*** 2128,2133 ****
--- 2128,2143 ----
  
    xops[2] = stack_pointer_rtx;
  
+   /* When -fpic, we must emit a scheduling barrier, so that the instruction
+      that restores %ebx (which is PIC_OFFSET_TABLE_REGNUM), does not get
+      moved before any instruction which implicitly uses the got.  This
+      includes any instruction which uses a SYMBOL_REF or a LABEL_REF.
+ 
+      Alternatively, this could be fixed by making the dependence on the
+      PIC_OFFSET_TABLE_REGNUM explicit in the RTL.  */
+   if (flag_pic)
+     emit_insn (gen_blockage ());
+ 
    if (nregs > 1 || ! frame_pointer_needed)
      {
        if (frame_pointer_needed)

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

* Re: egcs release
  1997-08-27  6:01 Jim Wilson
@ 1997-08-27  6:19 ` Jeffrey A Law
  0 siblings, 0 replies; 8+ messages in thread
From: Jeffrey A Law @ 1997-08-27  6:19 UTC (permalink / raw)
  To: egcs

  In message <199708270601.XAA07324@cygnus.com>you write:
  > 	You didn't include any actual patch...
  > 
  > I have the patches.  Both were previously submitted to the gcc2 developers.
OK.

  > 
  >   > 	* sched.c (sched_analyze_2): Handle access stack memory
  >   > 	beyond the stack pointer via the frame pointer.
  >   > 	(STACK_POINTER_REG_NREGS): New. Default as 1.
  > 
  > There is incidentally already a fix for this in the gcc2 sources.
OK.  I don't see that there's any particular benefit in doing anything
different for this in egcs, so I'll extract the patch from the gcc2
tree and put it in egcs.

  > Both H.J. Lu's patch and the already installed gcc2 patch have advantages
  > and disadvantages.  I am kind of leaning towards the gcc2 one (or the sched
  > barrier after the prologue), as it does a much better job of avoiding
  > unnecessary instructions dependencies, and hence will hurt performance less> .
Agreed.  My vote is the gcc2 solution.

  > This patch is similar in spirit to the first.  It makes every instruction
  > using a SYMBOL_REF depend on any instruction which sets the
  > PIC_OFFSET_TABLE_REGNUM.  This is because, when pic, instructions using
  > a SYMBOL_REF implicitly depend on this register.
Eee-yuk.

Well, I'm going to sound like Kenner, but when you lie to the compiler,
bad things happen.

Short term, I think a barrier would be fine or showing the use of
the pic register in RTL (the barrier is obviously a quicker solution).

Long term I think we really need to rethink how PIC works; the current
scheme does lead to "little white lies" that bite us regularly.

It also tends to pessimize loops which make PIC references.  Loop
does nothing when it finds a loop with a hard register that is
referenced, but never set -- as is the case with the PIC register.

Fixing this for static store data access on the PA (which is pic-like)
was the single biggest performance improvement I've made in the five
years I've been working on the PA port.

[ The difference on the PA is the dp/gp register is set in crt0
  and effectively read-only throughout the life of the program,
  thus showing it in loads/stores really provides no useful
  information to the compiler.  True PIC references on the PA
  actually show the pic register (which is different from dp/gp). ]

Jeff

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

* Re: egcs release
@ 1997-08-27  6:01 Jim Wilson
  1997-08-27  6:19 ` Jeffrey A Law
  0 siblings, 1 reply; 8+ messages in thread
From: Jim Wilson @ 1997-08-27  6:01 UTC (permalink / raw)
  To: egcs

	You didn't include any actual patch...

I have the patches.  Both were previously submitted to the gcc2 developers.

  > 	* sched.c (sched_analyze_2): Handle access stack memory
  > 	beyond the stack pointer via the frame pointer.
  > 	(STACK_POINTER_REG_NREGS): New. Default as 1.

There is incidentally already a fix for this in the gcc2 sources.
The fix in gcc2 solves this problem by adding a set of FP in the instruction
that sets the SP, thus any instruction using fp then becomes dependent on
the instruction that sets the SP.  This has roughly the same affect as adding
a scheduling barrier, but allows a little more scheduling freedom, and is
perhaps a little less safe.

Both H.J. Lu's patch and the already installed gcc2 patch have advantages
and disadvantages.  I am kind of leaning towards the gcc2 one (or the sched
barrier after the prologue), as it does a much better job of avoiding
unnecessary instructions dependencies, and hence will hurt performance less.

	I'd have to see the patch to be able to comment on this.

This patch is similar in spirit to the first.  It makes every instruction
using a SYMBOL_REF depend on any instruction which sets the
PIC_OFFSET_TABLE_REGNUM.  This is because, when pic, instructions using
a SYMBOL_REF implicitly depend on this register.

The general consensus when this first came up is that the x86 back end should
emit RTL that explicitly uses PIC_OFFSET_TABLE_REGNUM in the RTL, so that the
dependence is obvious to all gcc optimization passes.  No one tried to
implement this though, and it isn't clear if this is practical.

I suspect what really needs to be done here is put some kind of scheduling
barrier before the epilogue.  It is an epilogue insn moved towards the front
of the function that is causing the problem.  I still need to look at this
some more though.  I have only taken a superficial look so far.

Jim

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

* Re: egcs release
  1997-08-26 23:42 -g1 lossage Jeffrey A Law
@ 1997-08-26 23:42 ` Jeffrey A Law
  0 siblings, 0 replies; 8+ messages in thread
From: Jeffrey A Law @ 1997-08-26 23:42 UTC (permalink / raw)
  To: egcs

You didn't include any actual patch...

  In message <m0x33vo-0004ecC@ocean.lucon.org>you write:
  > Wed Jul 30 14:43:34 1997  H.J. Lu  (hjl@gnu.ai.mit.edu)
  > 
  > 	* sched.c (sched_analyze_2): Handle access stack memory
  > 	beyond the stack pointer via the frame pointer.
  > 	(STACK_POINTER_REG_NREGS): New. Default as 1.
I would recommend against this.

The way to handle this is to emit a barrier before cutting back
the stack in the epilogue.  At least that's the way the vast
majority of targets handle this problem.



  > Sun Jul 13 13:39:15 1997  H.J. Lu  (hjl@gnu.ai.mit.edu)
  > 
  > 	* sched.c (sched_analyze_2): Handle USE_PIC_OFFSET_TABLE_REG if
  > 	defined.
  > 	(PIC_OFFSET_TABLE_REG_NREGS): New. Default as 1.
  > 
  > 	* config/i386/i386.h (USE_PIC_OFFSET_TABLE_REG): New. True if
  > 	the PIC base register is used.
I'd have to see the patch to be able to comment on this.

jeff

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

* Re: egcs release
@ 1997-08-25 18:29 H.J. Lu
  0 siblings, 0 replies; 8+ messages in thread
From: H.J. Lu @ 1997-08-25 18:29 UTC (permalink / raw)
  To: egcs

Hi,

The bugs fixed by the patches enclosed here should be fixed in
the first egcs release. Otherwise, even glibc may be miscompiled
on linux/x86.

BTW, my 970731-1/runit test triggers the second bug. The first
one is hard to write a generic test case for. You need to look
at the asm code to see the bug.

Thanks.


H.J.
---
Wed Jul 30 14:43:34 1997  H.J. Lu  (hjl@gnu.ai.mit.edu)

	* sched.c (sched_analyze_2): Handle access stack memory
	beyond the stack pointer via the frame pointer.
	(STACK_POINTER_REG_NREGS): New. Default as 1.

Sun Jul 13 13:39:15 1997  H.J. Lu  (hjl@gnu.ai.mit.edu)

	* sched.c (sched_analyze_2): Handle USE_PIC_OFFSET_TABLE_REG if
	defined.
	(PIC_OFFSET_TABLE_REG_NREGS): New. Default as 1.

	* config/i386/i386.h (USE_PIC_OFFSET_TABLE_REG): New. True if
	the PIC base register is used.

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

end of thread, other threads:[~1997-08-29  6:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-08-29  6:00 egcs release H.J. Lu
  -- strict thread matches above, loose matches on Subject: below --
1997-08-28 20:03 suggested addition to -Wparentheses: warn about ` ! x & 1 ' Jim Meyering
1997-08-28 20:03 ` egcs release Jim Wilson
1997-08-28 19:37 H.J. Lu
1997-08-27 22:01 Jim Wilson
1997-08-27  6:01 Jim Wilson
1997-08-27  6:19 ` Jeffrey A Law
1997-08-26 23:42 -g1 lossage Jeffrey A Law
1997-08-26 23:42 ` egcs release Jeffrey A Law
1997-08-25 18:29 H.J. Lu

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).