]> git.ipfire.org Git - thirdparty/gcc.git/commit
i386: Do not allow pointer conversion for CMPccXADD intrin under -O0
authorHaochen Jiang <haochen.jiang@intel.com>
Fri, 1 Nov 2024 07:59:47 +0000 (15:59 +0800)
committerHaochen Jiang <haochen.jiang@intel.com>
Fri, 1 Nov 2024 18:15:46 +0000 (02:15 +0800)
commitc5a36c4e591e41efe3e4d892ff62831d801752d3
treeecfaebba8a502053ada24f07d5bd3537e7050596
parente8689ac75faca61a0251d1098dbafa8c637ec489
i386: Do not allow pointer conversion for CMPccXADD intrin under -O0

The pointer conversion to wider type under macro would not consider
whether the higher bit is cleaned or not. It will lead to unexpected
cmp result.

After this change, it will throw an incompatible pointer type error just
like -O2 does currently.

gcc/ChangeLog:

* config/i386/cmpccxaddintrin.h (_cmpccxadd_epi32): Do not do
type conversion for pointer.
(_cmpccxadd_epi64): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/i386/cmpccxadd-1b.c: New test.
gcc/config/i386/cmpccxaddintrin.h
gcc/testsuite/gcc.target/i386/cmpccxadd-1b.c [new file with mode: 0644]