public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/21294] New: Missed removal of null pointer check
@ 2005-04-30 1:40 pinskia at gcc dot gnu dot org
2005-04-30 1:46 ` [Bug tree-optimization/21294] " pinskia at gcc dot gnu dot org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-30 1:40 UTC (permalink / raw)
To: gcc-bugs
struct f
{
int i;
};
void link_error ();
void g(struct f *i)
{
i->i = 1;
if (&i->i == 0)
link_error ();
}
int main()
{
struct f n;
g(&n);
}
There should be no references to link_error.
The following is optimized:
void link_error ();
void g(int *i)
{
*i = 1;
if (i == 0)
link_error ();
}
int main()
{
int n;
g(&n);
}
--
Summary: Missed removal of null pointer check
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21294
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/21294] Missed removal of null pointer check
2005-04-30 1:40 [Bug tree-optimization/21294] New: Missed removal of null pointer check pinskia at gcc dot gnu dot org
@ 2005-04-30 1:46 ` pinskia at gcc dot gnu dot org
2005-04-30 2:53 ` kazu at cs dot umass dot edu
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-30 1:46 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-30 01:46 -------
For VRP to catch this, extract_range_from_unary_expr has to be enhanced to deal with ADDR_EXPR.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21294
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/21294] Missed removal of null pointer check
2005-04-30 1:40 [Bug tree-optimization/21294] New: Missed removal of null pointer check pinskia at gcc dot gnu dot org
2005-04-30 1:46 ` [Bug tree-optimization/21294] " pinskia at gcc dot gnu dot org
@ 2005-04-30 2:53 ` kazu at cs dot umass dot edu
2005-04-30 3:33 ` kazu at cs dot umass dot edu
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: kazu at cs dot umass dot edu @ 2005-04-30 2:53 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |kazu at cs dot umass dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21294
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/21294] Missed removal of null pointer check
2005-04-30 1:40 [Bug tree-optimization/21294] New: Missed removal of null pointer check pinskia at gcc dot gnu dot org
2005-04-30 1:46 ` [Bug tree-optimization/21294] " pinskia at gcc dot gnu dot org
2005-04-30 2:53 ` kazu at cs dot umass dot edu
@ 2005-04-30 3:33 ` kazu at cs dot umass dot edu
2005-04-30 3:34 ` kazu at cs dot umass dot edu
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: kazu at cs dot umass dot edu @ 2005-04-30 3:33 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |kazu at cs dot umass dot edu
|dot org |
Status|UNCONFIRMED |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21294
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/21294] Missed removal of null pointer check
2005-04-30 1:40 [Bug tree-optimization/21294] New: Missed removal of null pointer check pinskia at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-04-30 3:33 ` kazu at cs dot umass dot edu
@ 2005-04-30 3:34 ` kazu at cs dot umass dot edu
2005-05-02 13:54 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: kazu at cs dot umass dot edu @ 2005-04-30 3:34 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From kazu at cs dot umass dot edu 2005-04-30 03:34 -------
I've got a patch in testing.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21294
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/21294] Missed removal of null pointer check
2005-04-30 1:40 [Bug tree-optimization/21294] New: Missed removal of null pointer check pinskia at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-04-30 3:34 ` kazu at cs dot umass dot edu
@ 2005-05-02 13:54 ` pinskia at gcc dot gnu dot org
2005-05-02 18:06 ` cvs-commit at gcc dot gnu dot org
2005-05-02 18:07 ` kazu at cs dot umass dot edu
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-02 13:54 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-02 13:54 -------
Patch posted here: <http://gcc.gnu.org/ml/gcc-patches/2005-05/msg00076.html>.
--
What |Removed |Added
----------------------------------------------------------------------------
URL| |http://gcc.gnu.org/ml/gcc-
| |patches/2005-
| |05/msg00076.html
Keywords| |patch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21294
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/21294] Missed removal of null pointer check
2005-04-30 1:40 [Bug tree-optimization/21294] New: Missed removal of null pointer check pinskia at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-05-02 13:54 ` pinskia at gcc dot gnu dot org
@ 2005-05-02 18:06 ` cvs-commit at gcc dot gnu dot org
2005-05-02 18:07 ` kazu at cs dot umass dot edu
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-05-02 18:06 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-05-02 18:06 -------
Subject: Bug 21294
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: kazu@gcc.gnu.org 2005-05-02 18:06:28
Modified files:
gcc : ChangeLog tree-vrp.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/gcc.dg/tree-ssa: pr21294.c
Log message:
gcc/
PR tree-optimization/21294
* tree-vrp.c (vrp_expr_computes_nonzero): New.
(extract_range_from_expr): Call vrp_expr_computes_nonzero.
testsuite/
PR tree-optimization/21294
* gcc.dg/tree-ssa/pr21294.c: New.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8562&r2=2.8563
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-vrp.c.diff?cvsroot=gcc&r1=2.14&r2=2.15
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5427&r2=1.5428
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/tree-ssa/pr21294.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21294
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/21294] Missed removal of null pointer check
2005-04-30 1:40 [Bug tree-optimization/21294] New: Missed removal of null pointer check pinskia at gcc dot gnu dot org
` (5 preceding siblings ...)
2005-05-02 18:06 ` cvs-commit at gcc dot gnu dot org
@ 2005-05-02 18:07 ` kazu at cs dot umass dot edu
6 siblings, 0 replies; 8+ messages in thread
From: kazu at cs dot umass dot edu @ 2005-05-02 18:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From kazu at cs dot umass dot edu 2005-05-02 18:07 -------
Just checked in a patch.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21294
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2005-05-02 18:07 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-30 1:40 [Bug tree-optimization/21294] New: Missed removal of null pointer check pinskia at gcc dot gnu dot org
2005-04-30 1:46 ` [Bug tree-optimization/21294] " pinskia at gcc dot gnu dot org
2005-04-30 2:53 ` kazu at cs dot umass dot edu
2005-04-30 3:33 ` kazu at cs dot umass dot edu
2005-04-30 3:34 ` kazu at cs dot umass dot edu
2005-05-02 13:54 ` pinskia at gcc dot gnu dot org
2005-05-02 18:06 ` cvs-commit at gcc dot gnu dot org
2005-05-02 18:07 ` kazu at cs dot umass dot edu
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).