public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/53364] [4.7/4.8 Regression] Wrong code generation
Date: Wed, 16 May 2012 10:32:00 -0000	[thread overview]
Message-ID: <bug-53364-4-btAqADQXCR@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53364-4@http.gcc.gnu.org/bugzilla/>

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-05-16
          Component|c++                         |tree-optimization
      Known to work|                            |4.6.3
   Target Milestone|---                         |4.7.1
     Ever Confirmed|0                           |1
      Known to fail|                            |4.7.1

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-05-16 10:28:58 UTC ---
Confirmed.  Reduced testcase:

extern "C" void abort (void);

template<typename _Tp>
inline const _Tp&
min(const _Tp& __a, const _Tp& __b)
{
  if (__b < __a)
    return __b;
  return __a;
}

struct A
{
  int m_x;

  explicit A(int x) : m_x(x) {}
  operator int() const { return m_x; }
};

struct B : public A
{
public:
  explicit B(int x) : A(x) {}
};

int data = 1;

int main()
{
  B b = B(10);
  b = min(b, B(data));
  if (b != 1)
    abort ();
  return 0;
}


  parent reply	other threads:[~2012-05-16 10:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-15 19:24 [Bug c++/53364] New: " foom at fuhm dot net
2012-05-16  4:13 ` [Bug c++/53364] " foom at fuhm dot net
2012-05-16  4:28 ` pinskia at gcc dot gnu.org
2012-05-16  4:54 ` foom at fuhm dot net
2012-05-16  8:54 ` glisse at gcc dot gnu.org
2012-05-16 10:32 ` rguenth at gcc dot gnu.org [this message]
2012-05-16 10:38 ` [Bug tree-optimization/53364] " rguenth at gcc dot gnu.org
2012-05-16 11:22 ` rguenth at gcc dot gnu.org
2012-05-16 13:11 ` rguenth at gcc dot gnu.org
2012-05-16 13:13 ` rguenth at gcc dot gnu.org
2012-05-16 13:19 ` 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-53364-4-btAqADQXCR@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).