public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/43361] missing uninitialized warning without optimization (loop representation)
       [not found] <bug-43361-4@http.gcc.gnu.org/bugzilla/>
@ 2011-09-28 22:54 ` paolo.carlini at oracle dot com
  2013-10-21 12:08 ` manu at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-09-28 22:54 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-28 22:40:56 UTC ---
Basing on the discussion, I'm closing this as wontfix.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/43361] missing uninitialized warning without optimization (loop representation)
       [not found] <bug-43361-4@http.gcc.gnu.org/bugzilla/>
  2011-09-28 22:54 ` [Bug c++/43361] missing uninitialized warning without optimization (loop representation) paolo.carlini at oracle dot com
@ 2013-10-21 12:08 ` manu at gcc dot gnu.org
  2021-03-29 17:19 ` [Bug tree-optimization/43361] missing uninitialized warning without optimization (-O0) (PHI in always_executed basic block) msebor at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: manu at gcc dot gnu.org @ 2013-10-21 12:08 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nocannedmeat at gmail dot com

--- Comment #6 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
*** Bug 58823 has been marked as a duplicate of this bug. ***
>From gcc-bugs-return-432347-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Oct 21 12:08:08 2013
Return-Path: <gcc-bugs-return-432347-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 30453 invoked by alias); 21 Oct 2013 12:08:07 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 30380 invoked by uid 48); 21 Oct 2013 12:08:04 -0000
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/58823] Uninitialized variable warning is missing
Date: Mon, 21 Oct 2013 12:08:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: manu at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cc resolution
Message-ID: <bug-58823-4-9RK7jJlGAT@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58823-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58823-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-10/txt/msg01491.txt.bz2
Content-length: 655

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |manu at gcc dot gnu.org
         Resolution|---                         |DUPLICATE

--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
You need to enable optimization (-O1) to get this warning.

*** This bug has been marked as a duplicate of bug 43361 ***
>From gcc-bugs-return-432349-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Oct 21 12:08:08 2013
Return-Path: <gcc-bugs-return-432349-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 30540 invoked by alias); 21 Oct 2013 12:08:08 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 30373 invoked by uid 48); 21 Oct 2013 12:08:03 -0000
From: "joerg.richter@pdv-fs.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/58825] New: endless loop compiling nested bind expression
Date: Mon, 21 Oct 2013 12:08:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 4.8.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: joerg.richter@pdv-fs.de
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-58825-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-10/txt/msg01493.txt.bz2
Content-length: 845

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX825

            Bug ID: 58825
           Summary: endless loop compiling nested bind expression
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: joerg.richter@pdv-fs.de

g++ -std=c++11 -x c++ -c - <<EOF
#include <functional>
using namespace std;
struct Win
{
    void setMini( bool );
    bool isMini();
};
bool neg( bool val );
void foo( Win* w )
{
  function<void()> a = bind( &Win::setMini, w, bind( neg, bind( &Win::isMini, w
) ) );
}
EOF


####################

Works with GCC 4.7.3

IMHO there are two bugs. One in libstdc++ that valid code is rejected. The
other one that the error reporting does not stop.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/43361] missing uninitialized warning without optimization (-O0) (PHI in always_executed basic block)
       [not found] <bug-43361-4@http.gcc.gnu.org/bugzilla/>
  2011-09-28 22:54 ` [Bug c++/43361] missing uninitialized warning without optimization (loop representation) paolo.carlini at oracle dot com
  2013-10-21 12:08 ` manu at gcc dot gnu.org
@ 2021-03-29 17:19 ` msebor at gcc dot gnu.org
  2021-03-30  7:10 ` rguenth at gcc dot gnu.org
  2022-08-29 13:25 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-03-29 17:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43361

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2010-03-14 15:45:50         |2021-3-29

--- Comment #14 from Martin Sebor <msebor at gcc dot gnu.org> ---
Reconfirmed with GCC 11 and the C test case below:

void f (int);

int main () {
        int i;
        int array[10];
        for (; i<10; ++i) {             // no warning
                f (i);                  // no warning
                array [i] = i;          // no warning, really hurts
        }
}

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/43361] missing uninitialized warning without optimization (-O0) (PHI in always_executed basic block)
       [not found] <bug-43361-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-03-29 17:19 ` [Bug tree-optimization/43361] missing uninitialized warning without optimization (-O0) (PHI in always_executed basic block) msebor at gcc dot gnu.org
@ 2021-03-30  7:10 ` rguenth at gcc dot gnu.org
  2022-08-29 13:25 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-03-30  7:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43361

--- Comment #15 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #14)
> Reconfirmed with GCC 11 and the C test case below:
> 
> void f (int);
> 
> int main () {
>         int i;
>         int array[10];
>         for (; i<10; ++i) {             // no warning
>                 f (i);                  // no warning
>                 array [i] = i;          // no warning, really hurts
>         }
> }

So what's going "wrong" here is that we figure the BB with the i<10 check
post-dominates the entry block and thus is always executed.  But when
doing warn_uninit on the SSA var we do not consider the value on the
always-executed path from entry (which is uninitialized i_3(D)).

That's for the early pass, the late pass doesn't run at -O0.

Note since we walk BBs in index order which 'i' we warn for is probably
random, I think we'll only warn once since we set TREE_NO_WARNING on the
underlying decl of the SSA name (that's probably misguided - different
SSA defs can have different uninit state).

It might be possible to populate possibly_undefined_names in the BB walk
by visiting PHIs and considering fallthru entries being taken to have this
work out without major restructuring of the pass (a lattice of "undefinedness"
would probably be more to the point).

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/43361] missing uninitialized warning without optimization (-O0) (PHI in always_executed basic block)
       [not found] <bug-43361-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-03-30  7:10 ` rguenth at gcc dot gnu.org
@ 2022-08-29 13:25 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-08-29 13:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43361

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #16 from Richard Biener <rguenth at gcc dot gnu.org> ---
Note GCC 12 now diagnoses this at -O0, reporting the first use:

> ../../obj-gcc12-g/gcc/cc1 -quiet t.c -Wall
t.c: In function 'main':
t.c:5:13: warning: variable 'array' set but not used
[-Wunused-but-set-variable]
    5 |         int array[10];
      |             ^~~~~
t.c:6:17: warning: 'i' is used uninitialized [-Wuninitialized]
    6 |         for (; i<10; ++i) {             // no warning
      |                ~^~~
t.c:4:13: note: 'i' was declared here
    4 |         int i;
      |             ^

PR101573 is a "duplicate" we have a testcase for now.

*** This bug has been marked as a duplicate of bug 101573 ***

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-29 13:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-43361-4@http.gcc.gnu.org/bugzilla/>
2011-09-28 22:54 ` [Bug c++/43361] missing uninitialized warning without optimization (loop representation) paolo.carlini at oracle dot com
2013-10-21 12:08 ` manu at gcc dot gnu.org
2021-03-29 17:19 ` [Bug tree-optimization/43361] missing uninitialized warning without optimization (-O0) (PHI in always_executed basic block) msebor at gcc dot gnu.org
2021-03-30  7:10 ` rguenth at gcc dot gnu.org
2022-08-29 13:25 ` rguenth at gcc dot gnu.org

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).