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 middle-end/38851] [4.4 regression] Compiler warns about uninitialized variable that is an object with a constructor
Date: Sat, 24 Jan 2009 09:22:00 -0000	[thread overview]
Message-ID: <20090124092214.28713.qmail@sourceware.org> (raw)
In-Reply-To: <bug-38851-17188@http.gcc.gnu.org/bugzilla/>



------- Comment #8 from rguenth at gcc dot gnu dot org  2009-01-24 09:22 -------
Smaller testcase:

struct Empty { Empty() {} };
struct Other {
  Other(const Empty& e_) : e(e_) {}
  Empty e;
};
void bar(Other&);
void foo()
{
  Empty e;
  Other o(e);
  bar(o);
}

RTL expansion removes the assignment, so we should be able to use the same
reasoning to disable the warning and/or to get rid of the assignment on
the tree level.  RTL uses expr_size() here, which yields const0_rtx for e
and o.  As this involves a langhook I think the correct thing is to fix
the missed-optimization and remove these stores during gimplification
(or from within the frontend, of course).


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lopezibanez at gmail dot
                   |                            |com, rguenth at gcc dot gnu
                   |                            |dot org
           Priority|P2                          |P1


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


  parent reply	other threads:[~2009-01-24  9:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-14 21:04 [Bug c++/38851] New: " nvachhar at google dot com
2009-01-14 21:05 ` [Bug c++/38851] " nvachhar at google dot com
2009-01-14 21:58 ` pinskia at gcc dot gnu dot org
2009-01-21 22:19 ` [Bug middle-end/38851] [4.3 regression] " bkoz at gcc dot gnu dot org
2009-01-21 22:41 ` [Bug middle-end/38851] [4.4 " bkoz at gcc dot gnu dot org
2009-01-21 22:49 ` [Bug c++/38851] " rguenth at gcc dot gnu dot org
2009-01-21 22:59 ` [Bug middle-end/38851] " pinskia at gcc dot gnu dot org
2009-01-23 19:32 ` bangerth at dealii dot org
2009-01-24  9:22 ` rguenth at gcc dot gnu dot org [this message]
2009-01-24  9:27 ` rguenth at gcc dot gnu dot org
2009-01-24 10:06 ` rguenth at gcc dot gnu dot org
2009-01-24 14:23 ` rguenth at gcc dot gnu dot org
2009-01-24 14:24 ` rguenth at gcc dot gnu dot org
2009-01-25 18:02 ` rguenth at gcc dot gnu dot org
2009-01-25 19:45 ` mmitchel at gcc dot gnu dot org
2009-01-25 20:00 ` rguenther at suse dot de
2009-01-25 20:04 ` mark at codesourcery dot com
2009-01-25 20:45 ` rguenther at suse dot de
2009-01-25 22:03 ` rguenth at gcc dot gnu dot org
2009-01-26  9:53 ` rguenth at gcc dot gnu dot org
2009-01-26  9:53 ` rguenth at gcc dot gnu dot org
2009-01-30 17:32 ` hjl 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=20090124092214.28713.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).