public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/42145] Incorrect "may be used uninitialized warning" for a very specific test case
[not found] <bug-42145-4@http.gcc.gnu.org/bugzilla/>
@ 2013-11-19 9:11 ` manu at gcc dot gnu.org
2013-11-19 22:16 ` law at redhat dot com
` (5 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: manu at gcc dot gnu.org @ 2013-11-19 9:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42145
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |NEW
Known to work| |
Keywords| |diagnostic
Last reconfirmed| |2013-11-19
Component|regression |tree-optimization
Blocks| |24639
Resolution|DUPLICATE |---
Ever confirmed|0 |1
Known to fail| |
--- Comment #4 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
PR20968 was closed, but this one is still valid in some cases. In particular
this testcase with -Os produces a warning.
int translate(int in);
int main(int argc, char* argv[])
{
int ret;
if (argc)
ret = translate(5);
if (!argc || !ret)
ret = 1;
return ret;
}
The reason is that with -Os, the check "if (!argc || !ret)" is transformed
into:
# ret_1 = PHI <ret_5(D)(2), [pr19085.c : 8:9] ret_8(3)>
# .MEM_3 = PHI <.MEM_6(D)(2), .MEM_7(3)>
[pr19085.c : 10:7] # RANGE [0, 1]
_9 = argc_4(D) == 0;
[pr19085.c : 10:16] # RANGE [0, 1]
_10 = ret_1 == 0;
[pr19085.c : 10:13] # RANGE [0, 1]
_11 = _10 | _9;
[pr19085.c : 10:6] if (_11 != 0)
>From gcc-bugs-return-434973-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Nov 19 09:15:06 2013
Return-Path: <gcc-bugs-return-434973-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 16248 invoked by alias); 19 Nov 2013 09:15:06 -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 16205 invoked by uid 48); 19 Nov 2013 09:15:02 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/59183] configure of pdsh successfully checks for function shl_load when lto is enabled
Date: Tue, 19 Nov 2013 09:15:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: lto
X-Bugzilla-Version: 4.8.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth 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 resolution
Message-ID: <bug-59183-4-hrPa8vGig2@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59183-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59183-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-11/txt/msg01750.txt.bz2
Content-length: 981
http://gcc.gnu.org/bugzilla/show_bug.cgi?idY183
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Well, configure tests are usually not prepared for compilers applying a lot of
optimization - especially not assuming that it sees the whole program.
Thus, run configure tests with -O0, not with optimization.
This is hardly a GCC bug, it just optimized away the test which boils down to
char (*f) () = shl_load;
int
main ()
{
return f != shl_load;
}
where obviously the test is always false. LTO then can eliminate the global
variable 'f' because with -flto it knows it cannot be refered to from
elsewhere and whoops - the reference to shl_load is gone.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/42145] Incorrect "may be used uninitialized warning" for a very specific test case
[not found] <bug-42145-4@http.gcc.gnu.org/bugzilla/>
2013-11-19 9:11 ` [Bug tree-optimization/42145] Incorrect "may be used uninitialized warning" for a very specific test case manu at gcc dot gnu.org
@ 2013-11-19 22:16 ` law at redhat dot com
2013-11-19 22:19 ` law at redhat dot com
` (4 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: law at redhat dot com @ 2013-11-19 22:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42145
Jeffrey A. Law <law at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |law at redhat dot com
--- Comment #5 from Jeffrey A. Law <law at redhat dot com> ---
-Os disables jump threading except for very specific circumstances because the
block duplication generally increases code size. As a result of restricting
the optimizer, certain paths through the CFG which are unexecutable have to be
left in the CFG which leads to the false positive.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/42145] Incorrect "may be used uninitialized warning" for a very specific test case
[not found] <bug-42145-4@http.gcc.gnu.org/bugzilla/>
2013-11-19 9:11 ` [Bug tree-optimization/42145] Incorrect "may be used uninitialized warning" for a very specific test case manu at gcc dot gnu.org
2013-11-19 22:16 ` law at redhat dot com
@ 2013-11-19 22:19 ` law at redhat dot com
2013-11-19 22:23 ` law at redhat dot com
` (3 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: law at redhat dot com @ 2013-11-19 22:19 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42145
Jeffrey A. Law <law at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |arequipeno at gmail dot com
--- Comment #6 from Jeffrey A. Law <law at redhat dot com> ---
*** Bug 58698 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/42145] Incorrect "may be used uninitialized warning" for a very specific test case
[not found] <bug-42145-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2013-11-19 22:19 ` law at redhat dot com
@ 2013-11-19 22:23 ` law at redhat dot com
2013-11-19 22:30 ` law at redhat dot com
` (2 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: law at redhat dot com @ 2013-11-19 22:23 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42145
Jeffrey A. Law <law at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rbd at debian dot org
--- Comment #7 from Jeffrey A. Law <law at redhat dot com> ---
*** Bug 58455 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/42145] Incorrect "may be used uninitialized warning" for a very specific test case
[not found] <bug-42145-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2013-11-19 22:23 ` law at redhat dot com
@ 2013-11-19 22:30 ` law at redhat dot com
2013-11-20 0:42 ` law at redhat dot com
2013-11-20 1:13 ` law at redhat dot com
6 siblings, 0 replies; 7+ messages in thread
From: law at redhat dot com @ 2013-11-19 22:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42145
Jeffrey A. Law <law at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ppluzhnikov at google dot com
--- Comment #8 from Jeffrey A. Law <law at redhat dot com> ---
*** Bug 57072 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/42145] Incorrect "may be used uninitialized warning" for a very specific test case
[not found] <bug-42145-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2013-11-19 22:30 ` law at redhat dot com
@ 2013-11-20 0:42 ` law at redhat dot com
2013-11-20 1:13 ` law at redhat dot com
6 siblings, 0 replies; 7+ messages in thread
From: law at redhat dot com @ 2013-11-20 0:42 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42145
Jeffrey A. Law <law at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bp at alien8 dot de
--- Comment #9 from Jeffrey A. Law <law at redhat dot com> ---
*** Bug 55759 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/42145] Incorrect "may be used uninitialized warning" for a very specific test case
[not found] <bug-42145-4@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2013-11-20 0:42 ` law at redhat dot com
@ 2013-11-20 1:13 ` law at redhat dot com
6 siblings, 0 replies; 7+ messages in thread
From: law at redhat dot com @ 2013-11-20 1:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42145
Jeffrey A. Law <law at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |lacombar at gmail dot com
--- Comment #10 from Jeffrey A. Law <law at redhat dot com> ---
*** Bug 49848 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-11-20 1:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-42145-4@http.gcc.gnu.org/bugzilla/>
2013-11-19 9:11 ` [Bug tree-optimization/42145] Incorrect "may be used uninitialized warning" for a very specific test case manu at gcc dot gnu.org
2013-11-19 22:16 ` law at redhat dot com
2013-11-19 22:19 ` law at redhat dot com
2013-11-19 22:23 ` law at redhat dot com
2013-11-19 22:30 ` law at redhat dot com
2013-11-20 0:42 ` law at redhat dot com
2013-11-20 1:13 ` law at redhat dot com
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).