This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
ALERT: egcs bug in cast unsigned->double (fwd)
- To: dje at watson dot ibm dot com
- Subject: ALERT: egcs bug in cast unsigned->double (fwd)
- From: Fred Bacon <bacon at aerodyne dot com>
- Date: Tue, 10 Nov 1998 09:57:15 -0500 (EST)
- cc: law at cygnus dot com, egcs at cygnus dot com
This may be a duplicate report, but I'm concerned that it may not have
been sent to you. Anyway, the attached code shows a problem with the ppc
implementation of egcs on multiple machines and operating systems.
The original report came from Albrecht Dress. If this is a duplication, I
apologize.
> I second that. Incidently it also happens with egcs 1.1b in AIX 3.2.5 on
a
> RS/6000 box. It definitely looks like a bug in all ppc egcs ports since
> the code works perfectly with native the AIX compiler. BTW, the address
> for submitting bug report is egcs-bugs@cygnus.com.
>
> ---
> Amal Phadke
> Department of Ocean Engineering
> University of Hawaii at Manoa
>
> e-mail: phadke@kewalo.eng.hawaii.edu (MkLinux DR3)
Fred Bacon
==========================================================================
Aerodyne Research, Inc. Phone: (978) 663-9500 ext. 273
45 Manning Rd. FAX: (978) 663-4918
Billerica, MA 01821-3976 http://www.aerodyne.com
==========================================================================
Chase the dream, not the competition.
---------- Forwarded message ----------
Date: Thu, 5 Nov 1998 18:07:35 +0100 (MET)
From: Albrecht Dress <ad@Speckle.mpifr-bonn.mpg.de>
To: MkLinux Setup <mklinux-setup@public.lists.apple.com>
Cc: LinuxPPC <linux-pmac@samba.anu.edu.au>
Subject: ALERT: egcs bug in cast unsigned->double
Hi all,
I would like to warn all programmers about a bug in egcs-2.90.25
980302 (egcs-1.0.2 prerelease) on MkLinux/PowerPC G3 (and possibly other
ppc platforms). Save the two files below, chmod 755 Check.sh, and run
Check.sh. On my system (Apple PowerBook G3/300, MkLinux DR3), the Check
program failes on casting the unsigned types. I don't have the address
of the egcs bug list, could someone forward this mail to them?
Thanks and happy hacking,
Albrecht.
---Snip here and save as "Check.sh"---
#!/bin/bash
for type in INT UINT SHORT USHORT ; do
echo "$type:"
gcc -D$type -O3 Check.c -o Check
Check
done
-----------------
---Snip here and save as "Check.c"---
#include <stdio.h>
#ifdef INT
typedef int chktype;
#elif USHORT
typedef unsigned short chktype;
#elif UINT
typedef unsigned int chktype;
#elif SHORT
typedef short chktype;
#else
#error "no type defined!"
#endif
int main (void)
{
chktype a [512][512];
double b;
a [123][456] = 1009;
b = (double)a [123][456];
printf ("%d == %g ?????\n", a [123][456], b);
return 0;
}
----------------------