[Bug c++/71942] [ARM] Zero-extending whats allready zero-extended even when -O3

albrecht.guendel at web dot de gcc-bugzilla@gcc.gnu.org
Wed Jul 20 08:38:00 GMT 2016


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

--- Comment #1 from Albi <albrecht.guendel at web dot de> ---
To give a minimum case:

int main(void)
{
    volatile unsigned short foo = 0;
    while(1) foo ^= 1;
}

creates:
ldrh.w  r3, [sp, #6]
uxth    r3, r3        << again no reason for this
eor.w   r3, r3, #1
strh.w  r3, [sp, #6]


More information about the Gcc-bugs mailing list