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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-02-11
          Component|c                           |middle-end
     Ever Confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-11 
05:02:22 UTC ---
;; D.1714_2 = ~D.1713_1;

(insn 10 9 0 (parallel [
            (set (reg:QI 60 [ D.1714 ])
                (xor:QI (reg:QI 59 [ D.1713 ])
                    (const_int 1 [0x1])))
            (clobber (reg:CC 17 flags))
        ]) t77.c:14 -1
     (nil))

;; b.0_3 = (int) D.1714_2;

(insn 11 10 0 (set (reg:SI 61 [ b.0 ])
        (sign_extend:SI (reg:QI 60 [ D.1714 ]))) t77.c:14 -1
     (nil))


Confirmed, this is an expand issue, the ~ is being expanded incorrectly.
Here is a testcase for all optimizations level (except whole program):
struct S0
{
  int f2:1;
};

struct S0 c;

int b;

int main (void)
{
  b = -1 ^ c.f2;
  if (b != -1)
    __builtin_abort();
  return 0;
}

Reply via email to