]> git.ipfire.org Git - thirdparty/gcc.git/commit
middle-end/101478 - ICE with degenerate address during gimplification
authorRichard Biener <rguenther@suse.de>
Wed, 31 Jul 2024 08:07:45 +0000 (10:07 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 24 Jun 2025 08:21:14 +0000 (10:21 +0200)
commit05b347c5322a50195aa3ab0d06f2058f0ccee956
tree7c9ddacc79edf217b3ae63f4e7b7b85a456f8e1c
parente5d24c4e89ae6d8c08f85f3425ea9c29dd0e6646
middle-end/101478 - ICE with degenerate address during gimplification

When we gimplify &MEM[0B + 4] we are re-folding the address in case
types are not canonical which ends up with a constant address that
recompute_tree_invariant_for_addr_expr ICEs on.  Properly guard
that call.

PR middle-end/101478
* gimplify.cc (gimplify_addr_expr): Check we still have an
ADDR_EXPR before calling recompute_tree_invariant_for_addr_expr.

* gcc.dg/pr101478.c: New testcase.

(cherry picked from commit 33ead6400ad59d4b38fa0527a9a7b53a28114ab7)
gcc/gimplify.cc
gcc/testsuite/gcc.dg/pr101478.c [new file with mode: 0644]