Bug report (bis)
Jeffrey A Law
law@upchuck.cygnus.com
Wed Mar 31 23:54:00 GMT 1999
In message < 36F43681.A3A08222@ens.fr >you write:
> A shorter program showing the bug is:
>
> essai2.c:
>
> /* ----------------------- CUT HERE -------------------------- */
> #include <stdio.h>
>
> void in_cksum(short *w) {
> short answer = 0;
>
> *(char *)(&answer) = *(char *)w ;
> printf ("answer=%hu\n", answer);
> }
>
> int main (int argc, char **argv) {
> short a[1]={0};
>
> in_cksum (a);
> return 0;
> }
> /* ----------------------- CUT HERE -------------------------- */
>
>
> and the result:
>
> % gcc -Wall -o essai2 essai2.c && essai2
> answer=0
> % gcc -O2 -Wall -o essai2 essai2.c && essai2
> answer=63488
I just tried this testcase with the current development sources and it
works fine now. I also tried your larger testcase and it works too.
jeff
More information about the Gcc-bugs
mailing list