https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112545

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=110932

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jeffrey A. Law from comment #5)
> So I've been pondering this a bit and I think there's a reasonable path
> forward here.
> 
> Given something like A eq/ne (A relop C) we ought to be able to cobble
> together a match.pd pattern which tests the possibilities and simplifies the
> code.
> 
> If we think about the EQ case.  We just need to test 0 EQ (0 relop C) and 1
> EQ  (1 relop C).  If both are false, then the entire condition is false.  If
> only one of them is true, then we can simplify to A == 0 or A == 1 depending
> on which was true.  If both are true, then it simplifies to (unsigned) A <=
> 1.
> 
> We can construct something roughtly similar for NE.

That is basically what I mentioned in PR 110932 and also recorded in PR 110293
:).

Reply via email to