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

Wilco <wilco at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-01-07
                 CC|                            |wilco at gcc dot gnu.org
          Component|target                      |middle-end
            Summary|union bug on ARM64          |Big-endian union bug
     Ever confirmed|0                           |1

--- Comment #1 from Wilco <wilco at gcc dot gnu.org> ---
Confirmed - this is a generic mid-end bug that happens in fre1 when it replaces
the bitfield store and load with the wrong bitfield extract:

Test_func (U32 ulAddr)
{
  union HEAD_REQ_DW4_UNION unData;
  unsigned int _1;
  <unnamed-unsigned:30> _2;
  int _4;
  unsigned int _7;
  int _9;
  short unsigned int _10;
  int _11;
  short unsigned int _23;

  <bb 2> :
  _1 = ulAddr_12(D) >> 2;
  _2 = (<unnamed-unsigned:30>) _1;
  unData.strMemHead.b30AddrL = _2;
  unData.strMemHead.b2AddrType = 0;
  _4 = (int) _2;
  printf ("unData.strMemHead.b30AddrL=0x%x\r\n", _4);
  printf ("unData.strMemHead.b2AddrType=0x%x\r\n", 0);
  _7 = unData.aulValue[3];
  printf ("unData.aulValue[3]=0x%x\r\n", _7);
  _23 = BIT_FIELD_REF <_2, 16, 0>;            // WRONG: should be _2, 14, 0
  _9 = (int) _23;
  printf ("unData.ausValue[6]=0x%x\r\n", _9);
  _10 = unData.ausValue[7];
  _11 = (int) _10;
  printf ("unData.ausValue[7]=0x%x\r\n", _11);
  unData ={v} {CLOBBER};
  return 0;

}

Reply via email to