This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/13595] New: '-march=athlon-xp' option changes program behavior
- From: "stevech1097 at yahoo dot com dot au" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Jan 2004 10:08:25 -0000
- Subject: [Bug c/13595] New: '-march=athlon-xp' option changes program behavior
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The program file given below was compiled and run on an AMD AthlonXP
compiling with 'gcc file.c'
and running the program generates a SIGFPE exception
compiling with 'gcc -march=athlon-xp file.c'
and the SIGFPE exception is no longer generated
/* start of program file */
#include <stdio.h>
#include <signal.h>
#include <fpu_control.h>
void
sigfpe_handler (int signum)
{
printf("SIGFPE caught, exiting program.\n");
exit(1);
}
int
main()
{
fpu_control_t mask = _FPU_DEFAULT & ~_FPU_MASK_PM;
float f = 0.54030277F;
/* let the FPU generate an interrupt on a Precision (inexact result) error */
_FPU_SETCW(mask);
(void) signal (SIGFPE, sigfpe_handler);
printf("%.10f cast to int = %i\n", f, (int) f);
return 0;
}
/* end of program file */
--
Summary: '-march=athlon-xp' option changes program behavior
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: stevech1097 at yahoo dot com dot au
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13595