Bug 35412 - Correctness with -ftrapv depended on libcall notes
Summary: Correctness with -ftrapv depended on libcall notes
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: unknown
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
Keywords: wrong-code
: 39771 40143 (view as bug list)
Depends on: 101521 19020
Blocks: 35413
  Show dependency treegraph
Reported: 2008-02-29 23:23 UTC by Steven Bosscher
Modified: 2022-03-23 03:59 UTC (History)
5 users (show)

See Also:
Known to work: 4.3.1
Known to fail: 4.4.0
Last reconfirmed: 2009-04-14 20:08:33


Note You need to log in before you can comment on or make changes to this bug.
Description Steven Bosscher 2008-02-29 23:23:36 UTC
See http://gcc.gnu.org/ml/gcc-patches/2007-10/msg01011.html

``When -ftrapv is in effect, libcalls are "necessary" so that the results of an operation can be propagated without making the call to the libgcc functions dead. The attached patch causes a failure in pr30286.c.''

This has to be investigated before libcall notes can be removed from the compiler.
Comment 1 Richard Biener 2008-02-29 23:33:53 UTC
-ftrapv is seriously broken and nobody wants to fix it;  so the most appealing
solution is to remove support for -ftrapv.  See PR19020, especially the
libcall part is broken as well.
Comment 2 Steven Bosscher 2008-02-29 23:36:51 UTC
PR19020 shows that -ftrapv vs. libcalls is broken even without Paolo's patch.
Comment 3 Paolo Bonzini 2008-05-31 09:18:30 UTC
Well, regression is a big word because -ftrapv is broken in general.  I guess the RM will lower the priority.
Comment 4 Richard Biener 2008-06-25 11:54:48 UTC
Not a regression.  $Summary was true always.
Comment 5 Joseph S. Myers 2008-07-04 19:42:32 UTC
Not a regression, removing milestone.
Comment 6 Andrew Pinski 2009-04-14 19:59:50 UTC
*** Bug 39771 has been marked as a duplicate of this bug. ***
Comment 7 Joost VandeVondele 2009-04-14 20:08:31 UTC
I'm reopening this report. -ftrapv is still documented, so can be expected to work by users. 

For the particular problem I have right now, a functional version of this option would be a great thing to have.
Comment 8 Richard Biener 2009-05-14 10:55:36 UTC
*** Bug 40143 has been marked as a duplicate of this bug. ***
Comment 9 R0b0t1 2017-05-08 17:36:39 UTC
Please fix. Per the documentation available `-fsantize=undefined` provides some of the missing functionality but does not allow the program's flow to be altered.