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/30088] [4.1 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
Date: Mon, 05 Feb 2007 12:17:00 -0000	[thread overview]
Message-ID: <20070205121714.26117.qmail@sourceware.org> (raw)
In-Reply-To: <bug-30088-13701@http.gcc.gnu.org/bugzilla/>



------- Comment #4 from rguenth at gcc dot gnu dot org  2007-02-05 12:17 -------
Slightly reduced testcase:

#include <cassert>
#include <string>

struct A
{
  A() : _x(0.0), _y(0.0) { }
  float& f(const int& i) { return (i == 0 ? _x : _y); }
  float _x, _y;
};

A h(const char* s)
{
  A a;
  std::string b("");
  std::string s_(s);
  if (s_.compare(b) == 0)
    a.f(0) = a.f(1) = 1.0;
  else if (std::string(s).compare(std::string("")))
    s_.compare(b);
  return a;
}

int main()
{
  A a(h(""));
  assert(a._x > 0.0 && a._y > 0.0);
  return 0;
}

For some reason we see the stores to a._x and a._y in TMT.89:

  #   TMT.89_678 = V_MAY_DEF <TMT.89_677>;
  a._x = 0.0;
  #   TMT.89_679 = V_MAY_DEF <TMT.89_678>;
  a._y = 0.0;

but later discover they have SFTs (after copyprop1 where we cprop &a._x and
&a._y into the PHI node from the COND_EXPR inlined from A::f()):

  #   SFT.74_209 = V_MAY_DEF <SFT.74_11>;
  #   SFT.75_208 = V_MAY_DEF <SFT.75_9>;
  *D.17209_8 = 1.0e+0;
  #   VUSE <SFT.74_209>;
  #   VUSE <SFT.75_208>;
  D.16796_566 = *D.17209_8;

so this is either (again) a pruning issue or we get it wrong in the sense
that TMT.89 also is used for integer type.


-- 


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


  parent reply	other threads:[~2007-02-05 12:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-06 16:59 [Bug c++/30088] New: " heikki dot tauriainen at tkk dot fi
2006-12-06 17:01 ` [Bug c++/30088] " heikki dot tauriainen at tkk dot fi
2006-12-07  7:17 ` bangerth at dealii dot org
2006-12-07  7:23 ` [Bug tree-optimization/30088] " bangerth at dealii dot org
2006-12-27  0:06 ` [Bug tree-optimization/30088] [4.1 Regression] " pinskia at gcc dot gnu dot org
2007-01-25  5:59 ` mmitchel at gcc dot gnu dot org
2007-02-05 12:17 ` rguenth at gcc dot gnu dot org [this message]
2007-02-05 12:30 ` rguenth at gcc dot gnu dot org
2007-02-05 14:08 ` rguenth at gcc dot gnu dot org
2007-02-05 14:10 ` rguenth at gcc dot gnu dot org
2007-02-05 14:52 ` rguenth at gcc dot gnu dot org
2007-02-14  9:01 ` mmitchel at gcc dot gnu dot org
2007-04-25  0:12 ` janis at gcc dot gnu dot org
2007-04-25  0:17 ` pinskia at gcc dot gnu dot org
2007-11-14 10:00 ` steven at gcc dot gnu dot org
2007-11-14 17:51 ` janis at gcc dot gnu dot org
2007-11-14 18:36 ` manu at gcc dot gnu dot org
2007-12-26 16:17 ` [Bug tree-optimization/30088] [4.1/4.2 Regression] Unexpected compilation results: -O1 vs. -O2 reichelt at gcc dot gnu dot org
2007-12-26 16:19 ` reichelt at gcc dot gnu dot org
2007-12-26 16:38 ` [Bug tree-optimization/30088] [4.1/4.2 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing reichelt at gcc dot gnu dot org
2008-02-04 16:10 ` rguenth at gcc dot gnu dot org
2008-07-04 21:45 ` [Bug tree-optimization/30088] [4.2 " jsm28 at gcc dot gnu dot org
2009-03-30 19:44 ` jsm28 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=20070205121714.26117.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).