middle-end/99281 - avoid bitfield stores into addressable types
authorRichard Biener <rguenther@suse.de>
Fri, 26 Feb 2021 07:45:36 +0000 (08:45 +0100)
committerRichard Biener <rguenther@suse.de>
Fri, 26 Feb 2021 11:34:27 +0000 (12:34 +0100)
commitc173346aac4a66ad3747f380f2f0c97d2dbf8973
treed16ea8891b077209bea6a72523af2f259f0499fd
parent0f161cc8494cf7283a16fa9ebbcf8fd121bab68d
middle-end/99281 - avoid bitfield stores into addressable types

This avoids doing bitfield stores into the return object of calls
when using return-slot optimization and the type is addressable.
Instead we have to pass down the original target RTX to the call
expansion which otherwise tries to create a new temporary.

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

PR middle-end/99281
* expr.c (store_field): For calls with return-slot optimization
and addressable return type expand the store directly.

* g++.dg/pr99218.C: New testcase.
gcc/expr.c
gcc/testsuite/g++.dg/pr99218.C [new file with mode: 0644]