linux-kernel-digest V1 #112

Brian K. White linut en squonk.net
Vie Ene 28 05:17:18 CST 2000


> ------------------------------
> 
> From: "Johan Kullstam" <kullstam en ne.mediaone.net>
> Date: 27 Jan 2000 18:00:28 -0500
> Subject: Re: Preventing gcc from aligning stack???
> 
> Horst von Brand <vonbrand en sleipnir.valparaiso.cl> writes:
> 
> > My question in this vein would be the -fno-strength-reduce. The gcc bug
> > that placed this in the kernel was in gcc-2.7.2, and was worked around in
> > 2.7.2.3 by just making this option unconditional. Both 2.2.15pre4 and
> > 2.3.41pre2 at least demand gcc-2.7.2.3 as minimal version.
> 
> just when you thought it was safe to go into the water...
> 
> strength-reduction is broken again in gcc-2.95.2 (aka the current
> release).  i'm not sure about what versions actually do work.
> 
> for fun, try this one out.  cut and paste the program bug.c.
> 
> $ gcc -O2 bug.c -o b0
> $ gcc -O2 -fno-strength-reduce bug.c -o b1
> 
> run b1.  notice it finish immediately.
> now run b0.  notice how b0 never terminates (until you ^C it).
> 
> - -- bug.c -----------------------------------------
> static void bug(int size, int tries)
> {
>   int i;
>   int num = 0;
> 
>   while (num < size)
>   {
>     for (i = 1; i < tries; i++) num++;
>   }
> }
> 
> int main()
> {
>   bug(5, 10);
>   return 0;
> }
> - -- bug.c -----------------------------------------
> 
> - --
> J o h a n  K u l l s t a m
> [kullstam en ne.mediaone.net]
> Don't Fear the Penguin!

Just tried this on a SCO Open Server 5.0.5 box with 2.95.2 installed and it
did just what you describe. Thanks for the heads-up.

-- 
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+>+<---<---]>>++.<++.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo en vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



Más información sobre la lista de distribución Ayuda