This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/21368] New: VRP does not know that &s.a != NULL
- 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: 3 May 2005 19:38:31 -0000
- Subject: [Bug tree-optimization/21368] New: VRP does not know that &s.a != NULL
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Consider
struct s {
int a;
} s;
int
foo (void)
{
int *p = &s.a;
if (p == 0)
return 123;
/* Force VRP to run by having it insert at least one
ASSERT_EXPR. */
*p = 456;
return 0;
}
Note that with -fno-dominator-opts, VRP does not fold the "if" statement.
expr_computes_nonzero could use get_base_address.
--
Summary: VRP does not know that &s.a != NULL
Product: gcc
Version: unknown
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
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=21368