This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/51428] Some code after SSA expand does nothing
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 08 Jul 2017 17:32:06 +0000
- Subject: [Bug middle-end/51428] Some code after SSA expand does nothing
- Auto-submitted: auto-generated
- References: <bug-51428-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51428
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #1)
> Andrew, before I close this bug, would you like to shed some light on what
> you had in mind here? What sort of a resolution are you looking for?
So the reason why I said it was dead is because:
TREE_CODE (lhs) == COMPONENT_REF
&& (TREE_CODE (rhs) == BIT_IOR_EXPR
|| TREE_CODE (rhs) == BIT_AND_EXPR)
Can never be true after gimplification.
What this optimization is trying to do is the following:
struct f{
int i0:1;
int i1:1;
};
void or0(struct f *a)
{
a->i0 = a->i0 | a->i1;
}
into:
void or1(struct f *a)
{
if (a->i1 != 0)
a->i0 = 1;
}
And:
void and0(struct f *a)
{
a->i0 = a->i0 & a->i1;
}
into:
void and0(struct f *a)
{
if (a->i1 == 0)
a->i0 = 0;
}
------ CUT -----
Now this optimization has been disabled for ~8 years now and it might be better
if just removed.