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/38747] [4.4 Regression] Wrong code due to VIEW_CONVERT_EXPR



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


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