https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100792
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Joseph Myers <js...@gcc.gnu.org>: https://gcc.gnu.org/g:abea0dbd63ddb7e16d13806df929e1ef3b060091 commit r15-5827-gabea0dbd63ddb7e16d13806df929e1ef3b060091 Author: Joseph Myers <josmy...@redhat.com> Date: Sat Nov 30 16:15:51 2024 +0000 gimplify: Handle void expression as asm input [PR100501, PR100792] As reported in bug 100501 (plus duplicates), the gimplifier ICEs for C tests involving a statement expression not returning a value as an asm input; this includes the variant bug 100792 where the statement expression ends with another asm statement. The expected diagnostic for this case (as seen for C++ input) is one coming from the gimplifier and so it seems reasonable to fix the gimplifier to handle the GENERIC generated for this case by the C front end, rather than trying to make the C front end detect it earlier. Thus the gimplifier to handle a void expression like other non-lvalues for such a memory input. Bootstrapped with no regressions for x86_64-pc-linux-gnu. OK to commit? PR c/100501 PR c/100792 gcc/ * gimplify.cc (gimplify_asm_expr): Handle void expressions for memory inputs like other non-lvalues. gcc/testsuite/ * gcc.dg/pr100501-1.c, gcc.dg/pr100792-1.c: New tests. * gcc.dg/pr48552-1.c, gcc.dg/pr48552-2.c, gcc.dg/torture/pr98601.c: Update expected errors. Co-authored-by: Richard Biener <rguent...@suse.de>