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]

[Bug target/18665] -ftrapv borks up simple integer arithmetic


------- Additional Comments From steven at gcc dot gnu dot org  2004-11-28 00:22 -------
Much simpler test case: 
 
$ cat t.c 
extern int printf (__const char *__restrict __format, ...); 
 
int __attribute__ ((__noinline__)) 
foo (int a, int b) 
{ 
  return a - b; 
} 
 
int 
main (void) 
{ 
  printf ("%d\n", foo (2,3)); 
  return 0; 
} 
$ ../xgcc -B.. t.c 
$ ./a.out 
-1 
$ ../xgcc -B.. t.c -ftrapv 
$ ./a.out 
1073748906 
$ 
 
 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18665


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