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 c++/20487] Bad code generation caused by -fschedule-insns2


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-03-15 20:25 -------
  Type1* zone1 = reinterpret_cast<Type1*>(memory_block[0]);
  zone1->offset = 20;

  Type1* zone2 = reinterpret_cast<Type1*>(memory_block[20]);
  zone2->offset = 2 * 20;

  Type3* pageToUse = reinterpret_cast<Type3*>(memory_block[20]);


You are violating C++ aliasing rules. reinterpret_cast is still a normal cast.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20487


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