This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Bug report (bis)
- To: Olivier Baudron <Olivier dot Baudron at ens dot fr>
- Subject: Re: Bug report (bis)
- From: Jeffrey A Law <law at upchuck dot cygnus dot com>
- Date: Sat, 27 Mar 1999 22:04:30 -0700
- cc: egcs-bugs at egcs dot cygnus dot com
- Reply-To: law at cygnus dot com
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