public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/25962] New: Pointer (null) check after the use
@ 2006-01-26 0:09 uttamp at us dot ibm dot com
2006-01-26 0:12 ` [Bug tree-optimization/25962] " pinskia at gcc dot gnu dot org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: uttamp at us dot ibm dot com @ 2006-01-26 0:09 UTC (permalink / raw)
To: gcc-bugs
In file gcc/cgraphunit.c, function verify_cgraph_node(struct cgraph_node
*node), the input argument 'node' has been dereferenced before doing any
checking till on line 717 with following codition,
...
717 if (!node)
718 {
719 error ("node not found in DECL_ASSEMBLER_NAME hash");
720 error_found = true;
721 }
...
Shouldn't this code be moved at the begining of this function? before
de-referencing it?
Also, on line 789-793, if there is any error, we call dump_cgraph_node(), which
dumps the cgraph node. Shouldn't we do a check for non-null 'node', either here
before calling or in function dump_cgraph_node() itself? This has been,
reported as a possible error by 'coverity prevent tool'.
Any thoughts?
--
Summary: Pointer (null) check after the use
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: uttamp at us dot ibm dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25962
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/25962] Pointer (null) check after the use
2006-01-26 0:09 [Bug tree-optimization/25962] New: Pointer (null) check after the use uttamp at us dot ibm dot com
@ 2006-01-26 0:12 ` pinskia at gcc dot gnu dot org
2006-01-26 11:06 ` rguenth at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-26 0:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-01-26 00:12 -------
I noticed something like this in a different place (but only because I actually
triped over it).
There is another way you can find stuff like this one, by looking at the vrp
tree dump :).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25962
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/25962] Pointer (null) check after the use
2006-01-26 0:09 [Bug tree-optimization/25962] New: Pointer (null) check after the use uttamp at us dot ibm dot com
2006-01-26 0:12 ` [Bug tree-optimization/25962] " pinskia at gcc dot gnu dot org
@ 2006-01-26 11:06 ` rguenth at gcc dot gnu dot org
2006-01-26 21:27 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-01-26 11:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2006-01-26 11:06 -------
I believe the error is instead that
for (main_clone = cgraph_node (node->decl); main_clone;
main_clone = main_clone->next_clone)
if (main_clone == node)
break;
if (!node)
{
error ("node not found in DECL_ASSEMBLER_NAME hash");
error_found = true;
}
we should check main_clone here instead of node. Checking node makes no
sense here. Honza, can you confirm this?
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hubicka at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25962
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/25962] Pointer (null) check after the use
2006-01-26 0:09 [Bug tree-optimization/25962] New: Pointer (null) check after the use uttamp at us dot ibm dot com
2006-01-26 0:12 ` [Bug tree-optimization/25962] " pinskia at gcc dot gnu dot org
2006-01-26 11:06 ` rguenth at gcc dot gnu dot org
@ 2006-01-26 21:27 ` pinskia at gcc dot gnu dot org
2006-04-30 13:48 ` [Bug middle-end/25962] Pointer (null) check after the use in cgraph.c hubicka at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-26 21:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2006-01-26 21:27 -------
Confirmed.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-01-26 21:27:52
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25962
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/25962] Pointer (null) check after the use in cgraph.c
2006-01-26 0:09 [Bug tree-optimization/25962] New: Pointer (null) check after the use uttamp at us dot ibm dot com
` (2 preceding siblings ...)
2006-01-26 21:27 ` pinskia at gcc dot gnu dot org
@ 2006-04-30 13:48 ` hubicka at gcc dot gnu dot org
2006-05-04 12:43 ` hubicka at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: hubicka at gcc dot gnu dot org @ 2006-04-30 13:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from hubicka at gcc dot gnu dot org 2006-04-30 13:48 -------
testing patch.
--
hubicka at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |hubicka at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25962
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/25962] Pointer (null) check after the use in cgraph.c
2006-01-26 0:09 [Bug tree-optimization/25962] New: Pointer (null) check after the use uttamp at us dot ibm dot com
` (3 preceding siblings ...)
2006-04-30 13:48 ` [Bug middle-end/25962] Pointer (null) check after the use in cgraph.c hubicka at gcc dot gnu dot org
@ 2006-05-04 12:43 ` hubicka at gcc dot gnu dot org
2006-05-08 7:16 ` pinskia at gcc dot gnu dot org
2006-05-08 21:42 ` hubicka at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: hubicka at gcc dot gnu dot org @ 2006-05-04 12:43 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from hubicka at gcc dot gnu dot org 2006-05-04 12:43 -------
Subject: Bug 25962
Author: hubicka
Date: Thu May 4 12:42:55 2006
New Revision: 113522
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113522
Log:
PR middle-end/25962
* cgraphunit.c (verify_cgraph_node): Fix cgraph_hash testing.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cgraphunit.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25962
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/25962] Pointer (null) check after the use in cgraph.c
2006-01-26 0:09 [Bug tree-optimization/25962] New: Pointer (null) check after the use uttamp at us dot ibm dot com
` (4 preceding siblings ...)
2006-05-04 12:43 ` hubicka at gcc dot gnu dot org
@ 2006-05-08 7:16 ` pinskia at gcc dot gnu dot org
2006-05-08 21:42 ` hubicka at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-08 7:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pinskia at gcc dot gnu dot org 2006-05-08 07:15 -------
Fixed.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.2.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25962
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/25962] Pointer (null) check after the use in cgraph.c
2006-01-26 0:09 [Bug tree-optimization/25962] New: Pointer (null) check after the use uttamp at us dot ibm dot com
` (5 preceding siblings ...)
2006-05-08 7:16 ` pinskia at gcc dot gnu dot org
@ 2006-05-08 21:42 ` hubicka at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: hubicka at gcc dot gnu dot org @ 2006-05-08 21:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from hubicka at gcc dot gnu dot org 2006-05-08 21:42 -------
Subject: Bug 25962
Author: hubicka
Date: Mon May 8 21:42:17 2006
New Revision: 113633
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113633
Log:
PR middle-end/25962
* cgraphunit.c (decide_is_function_needed): When not optimizing even
unused static functions are needed.
* gcc.dg/pr25962.c: New.
Added:
trunk/gcc/testsuite/gcc.dg/pr25962.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cgraphunit.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25962
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2006-05-08 21:42 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-26 0:09 [Bug tree-optimization/25962] New: Pointer (null) check after the use uttamp at us dot ibm dot com
2006-01-26 0:12 ` [Bug tree-optimization/25962] " pinskia at gcc dot gnu dot org
2006-01-26 11:06 ` rguenth at gcc dot gnu dot org
2006-01-26 21:27 ` pinskia at gcc dot gnu dot org
2006-04-30 13:48 ` [Bug middle-end/25962] Pointer (null) check after the use in cgraph.c hubicka at gcc dot gnu dot org
2006-05-04 12:43 ` hubicka at gcc dot gnu dot org
2006-05-08 7:16 ` pinskia at gcc dot gnu dot org
2006-05-08 21:42 ` hubicka at gcc dot gnu dot 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).