public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "p.vanhoof at oma dot be" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/65425] New: code optimization leads to spurious FP exception
Date: Sat, 14 Mar 2015 17:14:00 -0000	[thread overview]
Message-ID: <bug-65425-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65425

            Bug ID: 65425
           Summary: code optimization leads to spurious FP exception
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: p.vanhoof at oma dot be

Created attachment 35035
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35035&action=edit
program that triggers the bug

Compile the attached test case with

gcc -O3 -ftrapping-math -fno-math-errno bug.c -lm

This produces no output. Running the executable will result in a spurious FP
exception. This happens with all gcc versions I tested since 4.7.0. Versions
4.6.4 and earlier work correctly, so this is a regression. It looks like the
code is being optimized with the implicit assumption that FP exceptions are not
trapped. However, using the -ftrapping-math flag should prevent such
optimizations (and should be the default as well).

% gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc492/libexec/gcc/x86_64-unknown-linux-gnu/4.9.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc492/configure --prefix=/usr/local/gcc492
--enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.9.2 (GCC)


             reply	other threads:[~2015-03-14 17:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-14 17:14 p.vanhoof at oma dot be [this message]
2015-03-18 12:10 ` [Bug tree-optimization/65425] " rguenth at gcc dot gnu.org
2015-03-18 12:10 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-65425-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).