Jakub Jelinek b4b50bf286 stor-layout: Create DECL_BIT_FIELD_REPRESENTATIVE even for bitfields in unions [PR101062]
The following testcase is miscompiled on x86_64-linux, the bitfield store
is implemented as a RMW 64-bit operation at d+24 when the d variable has
size of only 28 bytes and scheduling moves in between the R and W part
a store to a different variable that happens to be right after the d
variable.

The reason for this is that we weren't creating
DECL_BIT_FIELD_REPRESENTATIVEs for bitfields in unions.

The following patch does create them, but treats all such bitfields as if
they were in a structure where the particular bitfield is the only field.

2021-06-16  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/101062
	* stor-layout.c (finish_bitfield_representative): For fields in unions
	assume nextf is always NULL.
	(finish_bitfield_layout): Compute bit field representatives also in
	unions, but handle it as if each bitfield was the only field in the
	aggregate.

	* gcc.dg/pr101062.c: New test.
2021-06-16 12:17:55 +02:00
2021-06-15 00:16:37 +00:00
2021-06-14 00:16:35 +00:00
2021-06-15 00:16:37 +00:00
2021-06-12 00:16:27 +00:00
2021-06-09 00:16:30 +00:00
2021-06-10 14:41:23 -07:00
2021-06-16 00:17:05 +00:00
2021-06-06 00:16:22 +00:00
2021-06-12 00:16:27 +00:00
2021-06-09 00:16:30 +00:00
2021-06-16 00:17:05 +00:00
2021-06-06 00:16:22 +00:00
2021-05-29 10:59:54 -04:00
2021-05-29 10:59:54 -04:00
2021-06-05 09:55:33 -04:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 4.2 GiB
Languages
C++ 30.7%
C 30.2%
Ada 14.4%
D 6.1%
Go 5.7%
Other 12.4%