[Bug target/126513] [15,16,17] ICE ‘verify_gimple’ failed, since __builtin_ppc_atomic_cas_local added in r17-1992
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Aug 20 05:24:36 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126513
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Avinash Jayakar
<avinashd@gcc.gnu.org>:
https://gcc.gnu.org/g:d042b0db4bcdafe2362a86cd958dc8f2645b10e9
commit r16-9563-gd042b0db4bcdafe2362a86cd958dc8f2645b10e9
Author: Avinash Jayakar <avinashd@linux.ibm.com>
Date: Tue Aug 4 10:07:18 2026 +0530
rs6000: Fix type size checks for __builtin_ppc_atomic_cas_local
Type checks for the first 3 operands of the
__builtin_ppc_atomic_cas_local were missed with its initial
implementation. This patch adds the following checks
c1. Make sure the size of first 3 operands is the same.
c2. Do not allow function pointers as arguments.
c3. Report error when -mno-quad-memory-atomic is used but 128 bit
operands are used as the first 3 operands.
c4. A separate issue was when no lhs was assigned to this builtin, ICE
would
happen as a result of emit_cmp_and_jump_insns function dereferencing the
target rtx which would be null. Added the check in rs6000_expand_builtin
to allocate a reg_rtx if target is null or const0_rtx.
Tests have been added to check all the implemented checks described
above.
1. pr126513-acmp-tst-1.c: Checks c1 and c2.
2. pr126513-acmp-tst-2.c: Checks c3.
3. pr126513-acmp-tst-3.c: Checks the ICE in c4.
2026-08-04 Avinash Jayakar <avinashd@linux.ibm.com>
gcc/ChangeLog:
PR target/126513
* config/rs6000/rs6000-builtin.cc (rs6000_expand_builtin): Allocate
reg
if target is null or const0_rtx.
* config/rs6000/rs6000-c.cc (altivec_resolve_overloaded_builtin):
Add
error handling for c1, c2 and c3 described in this commit.
gcc/testsuite/ChangeLog:
PR target/126513
* gcc.target/powerpc/pr126513-acmp-tst-1.c: New test.
* gcc.target/powerpc/pr126513-acmp-tst-2.c: New test.
* gcc.target/powerpc/pr126513-acmp-tst-3.c: New test.
(cherry picked from commit c31b7a09eea3c33bccca12bab4a7bb6b01da1ff6)
More information about the Gcc-bugs
mailing list