public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55522] New: -funsafe-math-optimizations is unexpectedly harmful, especially w/ -shared
@ 2012-11-29  0:52 luto at mit dot edu
  2012-11-29  1:49 ` [Bug c++/55522] " luto at mit dot edu
                   ` (40 more replies)
  0 siblings, 41 replies; 42+ messages in thread
From: luto at mit dot edu @ 2012-11-29  0:52 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55522
           Summary: -funsafe-math-optimizations is unexpectedly harmful,
                    especially w/ -shared
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: luto@mit.edu


The docs for -funsafe-math-optimizations say:

When used at link-time, it may include libraries or startup files that change
the default FPU control word or other similar optimizations. 

This is, IMO, really bad.  One might naively assume (if you haven't thought
about that) that -ffast-math and -funsafe-math-optimizations merely affect code
generation.  This is true if you *compile* with -ffast-math, but if you *link*
with it, then you end up breaking IEEE758 semantics program-wide.  This causes
real-life problems.

Please consider some combination of:

1. Making -funsafe-math-optimizations illegal when combined with -shared.

2. Splitting the inclusion of crtfastmath.o into its own option
(-funsafe-math-mode-at-startup, perhaps) and make -ffast-math (and -Ofast) not
set that one.

3. Mention in the docs just how bad this is in shared libraries.


^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2023-10-17  7:08 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-29  0:52 [Bug c++/55522] New: -funsafe-math-optimizations is unexpectedly harmful, especially w/ -shared luto at mit dot edu
2012-11-29  1:49 ` [Bug c++/55522] " luto at mit dot edu
2012-11-29  8:57 ` [Bug target/55522] " rguenth at gcc dot gnu.org
2012-11-30  1:41 ` luto at mit dot edu
2015-04-28 18:23 ` orion at cora dot nwra.com
2021-10-06  1:15 ` ilya.konstantinov at gmail dot com
2022-09-06 22:40 ` foom at fuhm dot net
2022-09-06 22:55 ` pinskia at gcc dot gnu.org
2022-09-06 22:57 ` sam at gentoo dot org
2022-09-07 10:06 ` egallager at gcc dot gnu.org
2022-09-08 17:09 ` luto at kernel dot org
2022-09-09 10:32 ` rguenth at gcc dot gnu.org
2022-09-09 10:50 ` rguenth at gcc dot gnu.org
2022-09-11 15:46 ` brendandg at nyu dot edu
2022-09-12  7:01 ` rguenth at gcc dot gnu.org
2022-09-12  9:47 ` fw at gcc dot gnu.org
2022-09-14 17:03 ` brendandg at nyu dot edu
2022-10-07  9:27 ` aph at gcc dot gnu.org
2022-10-07 17:00 ` hjl.tools at gmail dot com
2022-10-10  9:17 ` fw at gcc dot gnu.org
2022-10-10 16:45 ` hjl.tools at gmail dot com
2022-10-10 16:46 ` hjl.tools at gmail dot com
2022-10-10 19:33 ` brendandg at nyu dot edu
2022-12-19 10:36 ` cvs-commit at gcc dot gnu.org
2022-12-26  1:12 ` cvs-commit at gcc dot gnu.org
2023-01-12 13:46 ` rguenth at gcc dot gnu.org
2023-01-13  3:35 ` sam at gentoo dot org
2023-01-13  7:47 ` rguenth at gcc dot gnu.org
2023-01-13 11:14 ` cvs-commit at gcc dot gnu.org
2023-01-13 11:14 ` cvs-commit at gcc dot gnu.org
2023-01-16 13:31 ` cvs-commit at gcc dot gnu.org
2023-01-18  2:46 ` cvs-commit at gcc dot gnu.org
2023-01-23 12:34 ` cvs-commit at gcc dot gnu.org
2023-01-27  3:26 ` cvs-commit at gcc dot gnu.org
2023-01-27 14:47 ` cvs-commit at gcc dot gnu.org
2023-01-27 14:47 ` cvs-commit at gcc dot gnu.org
2023-01-27 14:47 ` cvs-commit at gcc dot gnu.org
2023-01-27 14:47 ` cvs-commit at gcc dot gnu.org
2023-01-27 14:47 ` rguenth at gcc dot gnu.org
2023-04-30  3:58 ` arthur200126 at gmail dot com
2023-10-16 15:36 ` o.hlinka at gmail dot com
2023-10-17  7:08 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).