This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Strange regression in egcs-current/x86


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]