public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/34825] [4.2/4.3 regression] ICE with -funsafe-math-optimizations
Date: Thu, 17 Jan 2008 11:19:00 -0000	[thread overview]
Message-ID: <20080117104506.7789.qmail@sourceware.org> (raw)
In-Reply-To: <bug-34825-15643@http.gcc.gnu.org/bugzilla/>



------- Comment #4 from rguenth at gcc dot gnu dot org  2008-01-17 10:45 -------
So, we enter the recip pass with

<bb 2>:
  if (x_2(D) == y_3(D))
    goto <bb 3>;
  else
    goto <bb 4>;

<bb 3>:
  D.1547_4 = x_2(D) / x_2(D);
  D.1548_5 = D.1547_4 * x_2(D);
  D.1545_6 = D.1548_5 / x_2(D);

<bb 4>:
  # D.1545_1 = PHI <D.1545_6(3), 0.0(2)>
  return D.1545_1;

that is, we compute x/x*x/x.  Recip now 'optimizes' this to

  reciptmp.6_10 = 1.0e+0 / x_2(D);
  D.1547_4 = __builtin_pow (reciptmp.6_10, 2.0e+0);
  D.1548_5 = D.1547_4 * x_2(D);
  D.1545_6 = D.1548_5 * reciptmp.6_10;

which is bogus anyway.  But the ICE is gone :P

Well, it registers the division x_2(D)/x_2(D) twice, which also makes
it a wrong-code regression.

The easiest thing is probably to just not do reciprocal optimization
for x / x.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
           Priority|P3                          |P1


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


  parent reply	other threads:[~2008-01-17 10:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-17  7:20 [Bug c/34825] New: ICE (SIGSEGV) in compiling valid code " t-gcc-bugzilla at snowelm dot com
2008-01-17 10:00 ` [Bug tree-optimization/34825] [4.2/4.3 regression] ICE " reichelt at gcc dot gnu dot org
2008-01-17 10:45 ` ubizjak at gmail dot com
2008-01-17 11:10 ` rguenth at gcc dot gnu dot org
2008-01-17 11:19 ` rguenth at gcc dot gnu dot org [this message]
2008-01-17 11:27 ` ubizjak at gmail dot com
2008-01-17 12:29 ` rguenther at suse dot de
2008-01-17 12:43 ` rguenth at gcc dot gnu dot org
2008-01-17 13:23 ` [Bug tree-optimization/34825] [4.2 " rguenth at gcc dot gnu dot org
2008-02-01 17:03 ` jsm28 at gcc dot gnu dot org
2008-02-05 12:32 ` rguenth at gcc dot gnu dot org
2008-02-05 12:33 ` rguenth at gcc dot gnu dot 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=20080117104506.7789.qmail@sourceware.org \
    --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).