https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89698

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot 
gnu.org

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
OTOH I see DSE eliding b.y = 2 which points to that
the memory access in the BIT_FIELD_REF MEM_REF is done with TBAA type A.
Thus a bug in the BIT_FIELD_REF folding.

@@ -37,7 +37,6 @@
   _1 = &this_5(D)->D.2094;
   _2 = in_7(D) + -1;
   MEM[(struct  &)this_5(D)] ={v} {CLOBBER};
-  MEM[(struct A *)this_5(D)]._vptr.A = &MEM[(void *)&_ZTV1A + 16B];
   MEM[(struct A *)this_5(D)].x = _2;
   *this_5(D).D.2094._vptr.A = &MEM[(void *)&_ZTV1B + 16B];
   *this_5(D).y = in_7(D);
@@ -65,8 +64,6 @@
   MEM[(struct  &)&b] ={v} {CLOBBER};
   MEM[(struct  &)&b] ={v} {CLOBBER};
   MEM[(struct A *)&b].x = 1;
-  b.D.2094._vptr.A = &MEM[(void *)&_ZTV1B + 16B];
-  b.y = 2;
   _3 = MEM[(int (*) () *)&_ZTV1B];
   _4 = (sizetype) _3;
   iftmp.0_13 = &b.D.2094 + _4;
  _5 = BIT_FIELD_REF <MEM[(struct A *)iftmp.0_13], 64, 64>;
  _6 = (long unsigned int) _5;
  if (_5 == 8589934593)

fold_truth_andor_1 merges *(struct B *) VIEW_CONVERT_EXPR<void *>(vp) and
*(struct A *) VIEW_CONVERT_EXPR<void *>(vp) in a bogus way.  I've always
said this is premature but well...

Reply via email to