This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Strange regression in egcs-current/x86
- To: Jeffrey A Law <law at upchuck dot cygnus dot com>, ak at muc dot de
- Subject: Re: Strange regression in egcs-current/x86
- From: Arvind Sankar <arvinds at mit dot edu>
- Date: Mon, 29 Mar 1999 12:23:59 -0500
- Cc: egcs-bugs at egcs dot cygnus dot com
- References: <19980704150630.38682@kali.lrz-muenchen.de> <965.922706270@upchuck>
- Reply-To: Arvind Sankar <arvinds at mit dot edu>
On Mon, Mar 29, 1999 at 04:17:50AM -0700, Jeffrey A Law wrote:
> In message <19980704150630.38682@kali.lrz-muenchen.de>you write:
> > Hello,
> >
> > There is something strange in the x86 code generated by egcs-current.
> I don't think so.
>
> > f(int i)
> > {
> > float b[i + 1];
> >
> > for (int c = 0; c <= i; c++) {
> > b[c] = sin(c - 1); /* nonsense */
> > }
> > }
>
>
> > I know that often more primitive operations are faster on later x86 CPUs,
> > but I doubt that first shifting to the left, and the backshifting to the
> > right is the fastest way to do it. It seems some patterns got lost or the
> > combiner has some problems.
> Combining shifts like that is not safe.
>
> Consider the value 0x20000000
>
> If you shift it left 5 times, then shift it right 3 times you get the value
> zero.
>
> If you combine the shifts and just shift it left 2 times you get 0x80000000.
>
> jeff
But isn't the code asking for an array of size 0x80000000? Is this done because
we can't have negative array sizes on the stack?
-- arvind