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]
Other format: [Raw text]

c/7117: long double miscompilation on SparcV9


>Number:         7117
>Category:       c
>Synopsis:       long double miscompilation on SparcV9
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 25 07:56:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Wolfgang Bangerth
>Release:        gcc 3.1.0
>Organization:
>Environment:
solaris 2.9, sparcv9
>Description:
The following rather trivial code is miscompiled on
64bit Sparc when using -m64:
-----------------------
#include <stdio.h>
int main () {
  long double some_variable  = 1.;
  z = z-z/2;
  printf("%f\n", (double)z);  
};
-----------------------
It should of course print 0.500000, but prints 0.000000:

examples/step-11> gcc x.c ; ./a.out
0.500000

examples/step-11> gcc -m64 x.c ; ./a.out 
0.000000

Regards
  Wolfgang
>How-To-Repeat:
See above
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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