More .DEFERRED_INIT expansion rework
authorRichard Biener <rguenther@suse.de>
Tue, 5 Oct 2021 07:28:20 +0000 (09:28 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 5 Oct 2021 08:36:11 +0000 (10:36 +0200)
commit604459a09585314841cdce4698893c656481691b
treea8f82d7bd22dc7bd75558cbfacadc6e0bf3e6058
parent7646847df71e57edca5ec5b8c3c3dc4550dcb49d
More .DEFERRED_INIT expansion rework

This avoids looking at the type size and instead uses the size
as passed to .DEFERRED_INIT to determine the size of the non-MEM
to be initialized.  It also arranges for possibly poly-int
inits to always use zero-initialization rather than not initializing
and when we need to pun puns the LHS instead of the constant value.

That correctly initializes the variable-size typed array in the
testcase for PR102285 and the SVE vector in PR102587 where for
the testcase I needed to add a SVE capable -march as to not
ICE later.

2021-10-05  Richard Biener  <rguenther@suse.de>

PR middle-end/102587
PR middle-end/102285
* internal-fn.c (expand_DEFERRED_INIT): Fall back to
zero-initialization as last resort, use the constant
size as given by the DEFERRED_INIT argument to build
the initializer.

* gcc.target/aarch64/sve/pr102587-1.c: Add -march=armv8.3-a+sve.
* gcc.target/aarch64/sve/pr102587-2.c: Likewise.
gcc/internal-fn.c
gcc/testsuite/gcc.target/aarch64/sve/pr102587-1.c
gcc/testsuite/gcc.target/aarch64/sve/pr102587-2.c