public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manu at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/22456] [4.2/4.3/4.4 regression] missing "is used uninitialized" warning
Date: Sat, 07 Feb 2009 15:35:00 -0000	[thread overview]
Message-ID: <20090207153517.26728.qmail@sourceware.org> (raw)
In-Reply-To: <bug-22456-1771@http.gcc.gnu.org/bugzilla/>



------- Comment #17 from manu at gcc dot gnu dot org  2009-02-07 15:35 -------
Without optimization we build the following:

foo ()
{
  intD.0 iD.1591;

  # BLOCK 2
  # PRED: ENTRY (fallthru)
  [pr22456.c : 4] goto <bb 4>;
  # SUCC: 4 (fallthru)

  # BLOCK 3
  # PRED: 4 (true)
  [pr22456.c : 4] iD.1591_3 = iD.1591_1 + 1;
  # SUCC: 4 (fallthru)

  # BLOCK 4
  # PRED: 2 (fallthru) 3 (fallthru)
  # iD.1591_1 = PHI <iD.1591_2(D)(2), iD.1591_3(3)>
  [pr22456.c : 4] if (iD.1591_1 != 0)
    goto <bb 3>;
  else
    goto <bb 5>;
  # SUCC: 3 (true) 5 (false)

  # BLOCK 5
  # PRED: 4 (false)
  [pr22456.c : 5] return;
  # SUCC: EXIT

}

Because of the way the loop is represented, we generate a PHI node for the
condition instead of a direct use. Since we do not warn about PHI nodes without
optimization, then there is no warning.

With optimization the loop is completely removed since it doesn't do anything.
Hence, there is no warning. I wasn't able to construct a testcase where the
loop does anything useful (or the value of "i" is used after the loop) and we
do not warn.

This doesn't have anything to do with CCP and it is not a duplicate of bug
18501.

Closed as INVALID. If anyone comes up with a testcase for this where the loop
is not empty, open a new PR and add me to the CC.


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|18501                       |
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


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


  parent reply	other threads:[~2009-02-07 15:35 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-22456-1771@http.gcc.gnu.org/bugzilla/>
2005-10-12  0:21 ` [Bug middle-end/22456] [4.1 " pinskia at gcc dot gnu dot org
2005-10-31  4:07 ` mmitchel at gcc dot gnu dot org
2006-02-28 20:40 ` [Bug middle-end/22456] [4.1/4.2 " mmitchel at gcc dot gnu dot org
2006-05-25  2:45 ` mmitchel at gcc dot gnu dot org
2007-01-22 17:27 ` [Bug middle-end/22456] [4.1/4.2/4.3 " pinskia at gcc dot gnu dot org
2007-01-28 19:30 ` pinskia at gcc dot gnu dot org
2007-01-28 20:15 ` muntyan at tamu dot edu
2007-02-14  9:34 ` mmitchel at gcc dot gnu dot org
2007-02-19 10:12 ` pinskia at gcc dot gnu dot org
2007-02-19 18:44 ` pinskia at gcc dot gnu dot org
2007-04-11 21:17 ` rguenth at gcc dot gnu dot org
2007-04-11 21:25 ` rguenth at gcc dot gnu dot org
2007-08-15 15:02 ` manu at gcc dot gnu dot org
2007-08-15 15:05 ` manu at gcc dot gnu dot org
2007-08-16 15:22 ` dnovillo at gcc dot gnu dot org
2008-07-04 19:58 ` [Bug middle-end/22456] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
2009-02-07 15:35 ` manu at gcc dot gnu dot org [this message]
2009-02-07 20:35 ` muntyan at tamu dot edu
2009-02-07 20:59 ` manu at gcc dot gnu dot org
2009-02-07 21:33 ` manu at gcc dot gnu dot org
2009-06-17 11:47 ` rguenth at gcc dot gnu dot org
2009-06-17 12:00 ` [Bug middle-end/22456] [4.2/4.3/4.4 regression] (for empty loop) " manu at gcc dot gnu dot org
2009-07-12 21:57 ` reichelt at gcc dot gnu dot org
2009-07-13  6:44 ` manu 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=20090207153517.26728.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).