]> git.ipfire.org Git - thirdparty/gcc.git/commit
middle-end/103038 - avoid ICE with -ftrivial-auto-var-init=pattern
authorRichard Biener <rguenther@suse.de>
Tue, 2 Nov 2021 08:58:00 +0000 (09:58 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 2 Nov 2021 13:17:08 +0000 (14:17 +0100)
commit268b43d2592c196ea101946d7063156a914b2713
tree3cdfc73d8c35a206cc4e7aea218f84bb0412ac60
parentd5c6604f42034e36b149f899c5ddb93025a645b4
middle-end/103038 - avoid ICE with -ftrivial-auto-var-init=pattern

This avoids ICEing with expanding a VIEW_CONVERT_EXRP of a SSA name
on the LHS by making sure we can native-interpret OFFSET_TYPE and
by never building such a LHS but instead view-converting the RHS
for SSA LHS.

2021-11-02  Richard Biener  <rguenther@suse.de>

PR middle-end/103038
* fold-const.c (native_interpret_expr): Handle OFFSET_TYPE.
(can_native_interpret_type_p): Likewise.
* internal-fn.c (expand_DEFERRED_INIT): View-convert the
RHS if the LHS is an SSA name.

* g++.dg/pr103038.C: New testcase.
gcc/fold-const.c
gcc/internal-fn.c
gcc/testsuite/g++.dg/pr103038.C [new file with mode: 0644]