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

            Bug ID: 87131
           Summary: 16bit xor operation results in 32bit
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: john.k-askubuntu at decanary dot com
  Target Milestone: ---

//gcc ARM compiler, came with ti CCS v5

typedef short int int16_t;
int16_t a, b;
int result = 0;

a = 0x1234;
b = a ^ 0xa5a5;

if(b == (a ^ 0xa5a5))
{
   result = 1;
}

// result is 0
// in disassembly, R1 = 0x0000b791, R2 = 0xffffb791

Reply via email to