This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/19637] Missed constant propagation with placement new
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Feb 2005 09:39:46 -0000
- Subject: [Bug tree-optimization/19637] Missed constant propagation with placement new
- References: <20050126122555.19637.rguenth@tat.physik.uni-tuebingen.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rguenth at gcc dot gnu dot org 2005-02-10 09:39 -------
It's CCP that for foo_void is able to propagate &i[0] into the comparison here:
struct Foo * const this;
void * D.1798;
size_t D.1795;
void * __p;
int i[2];
struct Foo * i.6;
int D.1786;
struct Foo * iftmp.5;
void * D.1784;
struct Foo * D.1783;
<bb 0>:
__p_2 = &i[0];
this_6 = (struct Foo *) __p_2;
if (__p_2 != 0B) goto <L1>; else goto <L3>;
but not for foo_char, as here:
struct Foo * const this;
void * D.1821;
size_t D.1818;
void * __p;
int i[2];
struct Foo * i.4;
int D.1778;
struct Foo * iftmp.3;
void * D.1776;
char * i.2;
struct Foo * D.1765;
<bb 0>:
i.2_1 = (char *) &i;
__p_3 = i.2_1;
this_7 = (struct Foo *) __p_3;
if (__p_3 != 0B) goto <L1>; else goto <L3>;
I guess CCP is confused by the cast. So much for the char*/void* difference.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19637