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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2017-09-12
                 CC|                            |jakub at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
   Target Milestone|---                         |5.5
            Summary|gcc produces incorrect code |[5/6/7/8 Regression] gcc
                   |with -O2 and bit-field      |produces incorrect code
                   |                            |with -O2 and bit-field
     Ever confirmed|0                           |1

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Simplified testcase:
unsigned long long int a = 0x95dd3d896f7422e2ULL;
struct S { unsigned int m : 13; } b;

__attribute__((noinline, noclone)) void
foo (void)
{
  b.m = ((unsigned)a) >> (0x644eee9667723bf7LL | a & ~0xdee27af8U) -
0x644eee9667763bd8LL;
}

int
main ()
{
  if (__INT_MAX__ != 0x7fffffffULL)
    return 0;
  foo ();
  if (b.m != 0)
    __builtin_abort ();
  return 0;
}

Started with r191928 I believe (optimized dump is identical, r191925 works,
r191931 doesn't).  I'll have a look tomorrow.

Reply via email to