This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/53663] [4.7/4.8 Regression] inconsistent inline handling of bool within union
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 24 Sep 2012 11:44:32 +0000
- Subject: [Bug tree-optimization/53663] [4.7/4.8 Regression] inconsistent inline handling of bool within union
- Auto-submitted: auto-generated
- References: <bug-53663-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53663
--- Comment #13 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-24 11:44:32 UTC ---
This boils down to the question whether reading a 1-bit precision quantity
from memory has to disregard the upper bits or not (I think we had similar
issues with SRA). Thus, whether reading a _Bool from memory is a
bitfield extract or not (expansion does not treat it as bitfield extract
because the FIELD_DECLs size is 8, not 1).
We go into
/* 3) Assignment from a constant. We can use folds native encode/interpret
routines to extract the assigned bits. */
which has the issue that it doesn't work if TYPE_PRECISION is not equal
to TYPE_SIZE. At least not for detecting redundant stores (it does work
for folding a read of v.b though).
I have a patch.