https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83067
Bug ID: 83067 Summary: wrong code on arm-linux-gnueabi Product: gcc Version: 5.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: yangyibiao at nju dot edu.cn Target Milestone: --- $ arm-linux-gnueabi-gcc --version arm-linux-gnueabi-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ gcc --version gcc --version gcc (Ubuntu 5.4.1-2ubuntu1~16.04) 5.4.1 20160904 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ cat small.c #define f(g) ({ unsigned long long u = (g); -((unsigned long long)(u));}) void main() { printf("%d\n", f(65527)); } $ arm-linux-gnueabi-gcc -static small.c; ./a.out -150998972 $ gcc small.c; ./a.out -65527