This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/19659] GCC does not remove an "if" statement that never triggers.


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]