This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/38747] [4.4 Regression] Wrong code due to VIEW_CONVERT_EXPR
- 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: 20 May 2009 15:26:06 -0000
- Subject: [Bug tree-optimization/38747] [4.4 Regression] Wrong code due to VIEW_CONVERT_EXPR
- References: <bug-38747-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from rguenth at gcc dot gnu dot org 2009-05-20 15:26 -------
On a second thought this transformation is even wrong for non-indirect
references.
extern "C" void abort (void);
inline void *operator new (__SIZE_TYPE__, void *__p) throw () { return __p; }
int __attribute__((noinline))
foo(void)
{
float f = 0;
int *i = new (&f) int (1);
return *(int *)&f;
}
int main()
{
if (foo() != 1)
abort ();
return 0;
}
it is wrong to turn the float read into an int read converted via a
VIEW_CONVERT_EXPR.
I will remove all this VIEW_CONVERT_EXPR generation again.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38747