egcs 1.1.1 machine-independant code generation bug.

Jeffrey A Law law@cygnus.com
Fri Jan 15 00:14:00 GMT 1999


  In message < 199901150435.PAA14188@balrog.supp.cpr.itg.telecom.com.au >you writ
e:
  > I think the code fragment below shows the bug.  I haven't
  > included a pre-processed version because it only include
  > <stdio.h>, and the bug exists across operating systems
  > and the bug still exists with or without the include of
  > <stdio.h>.  Here's a run on a NetBSD/i386 machine:
This code is buggy.


  > #define LO5(x) (((unsigned long *) &x)[0])
  > #define HI5(x) (((unsigned long *) &x)[1])
When you use HI5 & LO5 in zsubmul5 you are passing it a double.


It is incorrect to access the same hunk of memory using different types like
this.  Put them in an union or access them with char * or void * pointers.

jeff
  



More information about the Gcc-bugs mailing list