This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/15826] don't use "if" to extract a single bit bit-field.
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 26 Feb 2016 23:25:29 +0000
- Subject: [Bug tree-optimization/15826] don't use "if" to extract a single bit bit-field.
- Auto-submitted: auto-generated
- References: <bug-15826-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=15826
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |msebor at gcc dot gnu.org
Known to work| |5.1.0, 6.0
Resolution|--- |FIXED
--- Comment #11 from Martin Sebor <msebor at gcc dot gnu.org> ---
It looks to me like the missing optimization now takes place, and has since
5.1. In both foo() and andrew() the bit test is optimized away during cddce2
resulting in the following. The BIT_FIELD_REF is still there, but I assume
that's fine. I'll go ahead, add the test case to the test suite and resolve
this as fixed. Please reopen if I missed something.
foo (struct s * p)
{
unsigned char _4;
_Bool _6;
unsigned int _7;
<bb 2>:
_4 = BIT_FIELD_REF <*p_3(D), 8, 0>;
_6 = (_Bool) _4;
_7 = (unsigned int) _6;
return _7;
}