This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/22117] New: VRP thinks <ptr type> + <ptr type> is always nonnull.
- From: "kazu at cs dot umass dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jun 2005 03:42:57 -0000
- Subject: [Bug tree-optimization/22117] New: VRP thinks <ptr type> + <ptr type> is always nonnull.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Consider:
void
foo (int *p, int q)
{
if (p == 0)
{
if (q == 0)
{
int *r = &p[q];
if (r != 0)
link_error ();
}
}
}
Note that the innermost "if" condition should be folded to false,
but VRP folds that to true.
Under "if (q == 0)", both p and q are known to be zero,
but VRP thinks that regardless of their values, p + q is always nonnull.
--
Summary: VRP thinks <ptr type> + <ptr type> is always nonnull.
Product: gcc
Version: unknown
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kazu at cs dot umass dot edu
CC: dnovillo at redhat dot com,gcc-bugs at gcc dot gnu dot
org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22117