Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Re: [davidm@azstarnet.com: Re: gcc-2.7.1 bug]
@ 1996-03-26 10:36 Richard Kenner
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Kenner @ 1996-03-26 10:36 UTC (permalink / raw)


I think there's more to it than this.  Note that there's a missing REG_DEAD
note on the new last use of $20 before it's reloaded as a parameter to
the called function.

I'd start with that; it may point to a more precise fix.

However, your fix will definately work and looks safe.

Thanks for investigating this far.  At least there's a temporary
solution to this problem.

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [davidm@azstarnet.com: Re: gcc-2.7.1 bug]
@ 1996-03-25 22:43 David Mosberger-Tang
  0 siblings, 0 replies; 3+ messages in thread
From: David Mosberger-Tang @ 1996-03-25 22:43 UTC (permalink / raw)


Here is a detailed description (and a small test program that
reproduces the problem) of the gcc bug I mentioned earlier today.
Richard Kenner determined that the latest gcc still has this problem.
It's apparently due to a bug in `combine' (not the instruction
scheduler as I guessed).  Since Richard won't be able to fix it
immediately, I thought I'd forward this to the mailing lists so people
know what exactly goes wrong.  Of course, if somebody could find a
fix, I'm sure Richard wouldn't mind receiving a patch either... :-)

	--david

------- Start of forwarded message -------
Return-Path: davidm
Date: Mon, 25 Mar 1996 13:01:18 -0700
From: David Mosberger-Tang <davidm@azstarnet.com>
To: kenner@vlsi1.ultra.nyu.edu, davidm
In-reply-to: <9603251224.AA13984@vlsi1.ultra.nyu.edu>
	(kenner@vlsi1.ultra.nyu.edu)
Subject: Re: gcc-2.7.1 bug

Just ran into another bug.  This time it's a code generation bug (it
looks like the instruction scheduler is overly aggressive).  Given
the code:

long
XGetRGBColormaps (dpy, w, stdcmap, count, property)
    void *dpy;
    long w;
    long **stdcmap;
    int *count;
    long property;
{
    long *data = 0;
    int actual_format;
    unsigned long nitems;
    unsigned long actual_type, leftover;

    if (XGetWindowProperty (dpy, w, property, 0L, 1000000L, 0,
			    27, &actual_type, &actual_format,
			    &nitems, &leftover, (unsigned char **)&data)
	!= 0)
      return 0;
    return 1;
}

If I translate this with gcc-2.7.1 with options -O2 -S, I get:

        .align 3
        .globl XGetRGBColormaps
        .ent XGetRGBColormaps
XGetRGBColormaps:
        ldgp $29,0($27)
XGetRGBColormaps..ng:
        lda $30,-112($30)
        .frame $30,112,$26,0
        stq $26,48($30)
        .mask 0x4000000,-64
        .prologue 1
        lda $20,16960		# <--------- overwrites a4
        bis $31,27,$1
        addq $30,72,$2
        addq $30,80,$3
        stq $31,96($30)
        addq $30,88,$4
        stq $1,0($30)
        addq $30,96,$1
        addq $30,64,$5
        stq $5,8($30)
        bis $31,$31,$19
        stq $2,16($30)
        bis $31,$31,$21
        stq $3,24($30)
        bis $20,$20,$18		# <- attempt to move old value of a4 into a2
        stq $4,32($30)
        ldah $20,15($20)	# <- finish loading constant 100000L into a4
        stq $1,40($30)
        jsr $26,XGetWindowProperty

So it looks like the "lda $20,16960" instruction incorrectly got moved
before the instruction that moves a4 into a2.

Correct code is generated if -O is used.

Can you reproduce this?

	--david

------- End of forwarded message -------

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

end of thread, other threads:[~1996-03-26 10:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <199603252243.PAA32288@koala.azstarnet.com>
1996-03-26  6:48 ` [davidm@azstarnet.com: Re: gcc-2.7.1 bug] Richard Henderson
1996-03-26 10:36 Richard Kenner
  -- strict thread matches above, loose matches on Subject: below --
1996-03-25 22:43 David Mosberger-Tang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox