Bug 39771 - ftrapv does not work
Summary: ftrapv does not work
Status: RESOLVED DUPLICATE of bug 35412
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-14 19:38 UTC by Joost VandeVondele
Modified: 2009-04-14 19:59 UTC (History)
2 users (show)

See Also:
Host:
Target: x86_64-unknown-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joost VandeVondele 2009-04-14 19:38:44 UTC
The following program doesn't generate a trap AFAICT, even though there is a signed overflow on a multiplication

 CALL FOO(1000000)
 END
 SUBROUTINE FOO(a)
  INTEGER :: a
  write(6,*) a*a
 END SUBROUTINE FOO

> gfortran -ftrapv test.f90
> ./a.out
  -727379968

fails for both
gcc version 4.4.0 20090414 (prerelease) [gcc-4_4-branch revision 146034] (GCC)
gcc version 4.5.0 20090414 (experimental) [trunk revision 146031] (GCC)
Comment 1 Andrew Pinski 2009-04-14 19:59:50 UTC

*** This bug has been marked as a duplicate of 35412 ***