]> git.ipfire.org Git - thirdparty/gcc.git/commit
Bail out early during gimplify_asm_expr [PR121391]
authorStefan Schulze Frielinghaus <stefansf@gcc.gnu.org>
Mon, 15 Sep 2025 07:10:53 +0000 (09:10 +0200)
committerStefan Schulze Frielinghaus <stefansf@gcc.gnu.org>
Mon, 15 Sep 2025 07:10:53 +0000 (09:10 +0200)
commit4cff794ca18a96ceeb83ccb18b08ffa0a63c58af
treeb07ce1f3951da47b6979ab92d4bc68d89dc4c224
parent8d264d90a22d5e13c876a4f352c702c7f5bc4f0b
Bail out early during gimplify_asm_expr [PR121391]

In case an asm operand is an error node, constraints etc. are still
validated.  Furthermore, all other operands are gimplified, although an
error is returned in the end anyway.  For hard register constraints an
operand is required in order to determine the mode from which the number
of registers follows.  Therefore, instead of adding extra guards, bail
out early.

gcc/ChangeLog:

PR middle-end/121391
* gimplify.cc (gimplify_asm_expr): In case an asm operand is an
error node, bail out early.

gcc/testsuite/ChangeLog:

* gcc.dg/pr121391-1.c: New test.
* gcc.dg/pr121391-2.c: New test.
gcc/gimplify.cc
gcc/testsuite/gcc.dg/pr121391-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr121391-2.c [new file with mode: 0644]