This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/19659] GCC does not remove an "if" statement that never triggers.
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Feb 2005 04:12:24 -0000
- Subject: [Bug tree-optimization/19659] GCC does not remove an "if" statement that never triggers.
- References: <20050127195923.19659.kazu@cs.umass.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-17 04:12 -------
This is not fully related to PR 18178 but this case is just a missed optimization dealing with const int *
vs int*.
Another testcase for the const* vs * is:
void link_error(void);
void f(void)
{
int a[1];
a[0] = 1;
const int *b = a;
if (*b != 1)
link_error();
}
If we look at the last tree dump we see there is a link_error in it.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19659