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: Bug report (bis)



  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


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