egcs 1.1.1 machine-independant code generation bug.

Jeffrey A Law
Fri Jan 15 00:14:00 GMT 1999

  In message < >you writ
  > 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.


More information about the Gcc-bugs mailing list