public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dominiq at lps dot ens.fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/43716] [4.6/4.7/4.8 Regression] Revision 158105 miscompiles doduc.f90
Date: Tue, 08 Jan 2013 19:53:00 -0000	[thread overview]
Message-ID: <bug-43716-4-j6GbyAD5BH@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-43716-4@http.gcc.gnu.org/bugzilla/>


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

--- Comment #48 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2013-01-08 19:52:39 UTC ---
>From comment #40:

> with -ffast-math, so for example
>
>   if (x != 0)
>     tem = y / x;
>   else
>     tem = 0.;
>   ... do sth with tem ...
>
> will execute y / x unconditionally based on the fact that it cannot trap.

This optimization generates an exception trapped when using -ffpe-trap=invalid
along with -ffast-math.
This unfortunately prevents any debugging based -ffpe-trap=invalid for
miscompilations occurring with -ffast-math. One thing I hope, though I am not
sure about it, is that the above block is still compiled as

tem=y/x
if (x==0) tem=0.

My original report was for '-O3 -funsafe-math-optimizations -ffinite-math-only'
without -ffpe-trap=invalid. The segmentation fault resulted from the fact that
some variables were used to access a table and were out of bound when the
miscompilation generated some NAN (see comment #13).


  parent reply	other threads:[~2013-01-08 19:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-43716-4@http.gcc.gnu.org/bugzilla/>
2012-07-21 10:42 ` ubizjak at gmail dot com
2012-07-21 10:45 ` ubizjak at gmail dot com
2012-07-21 10:49 ` ubizjak at gmail dot com
2012-07-21 11:31 ` ubizjak at gmail dot com
2012-07-21 12:17 ` ubizjak at gmail dot com
2012-07-21 12:35 ` ubizjak at gmail dot com
2012-07-21 13:40 ` dominiq at lps dot ens.fr
2012-07-21 13:52 ` ubizjak at gmail dot com
2012-07-21 14:43 ` dominiq at lps dot ens.fr
2012-07-22 10:48 ` dominiq at lps dot ens.fr
2012-07-23  8:13 ` rguenth at gcc dot gnu.org
2012-12-07  9:21 ` rguenth at gcc dot gnu.org
2012-12-07 13:40 ` dominiq at lps dot ens.fr
2012-12-07 14:29 ` rguenth at gcc dot gnu.org
2012-12-18  9:14 ` jakub at gcc dot gnu.org
2012-12-18 10:24 ` jakub at gcc dot gnu.org
2013-01-08 18:26 ` dominiq at lps dot ens.fr
2013-01-08 19:24 ` ubizjak at gmail dot com
2013-01-08 19:53 ` dominiq at lps dot ens.fr [this message]
2013-01-09  8:52 ` richard.guenther at gmail dot com

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-43716-4-j6GbyAD5BH@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).