This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/65317] [SH] Shifts used instead of and with const_int


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

Segher Boessenkool <segher at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |segher at gcc dot gnu.org

--- Comment #4 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Oleg Endo from comment #3)
> Segher, do you think it would make sense to extend combine so that for
> things like ...
> 
> Failed to match this instruction:
> (set (reg:SI 168 [ D.1470 ])
>     (and:SI (reg:SI 4 r4 [ a ])
>         (const_int -2147483648 [0xffffffff80000000])))
> 
> ... it would also try
> 
> (set (reg:SI 200) (const_int -2147483648))
> (set (reg:SI 168) (and:SI (reg:SI r4) (reg:SI 200)))
> 
> 
> I think in some cases it already does try things like that, but for some
> reason not in this case here.

Hi Oleg,

What are the original instructions it tried to combine here?  If the
combined insn does not match (as here), combine tries to split it into
two in various ways, but only if it started out with more than two insns.
Now that we also check for insn cost we could change that (allow combining
2->2 if that reduces the rtx cost), but this will of course need testing
everywhere.  I'll see what I can do.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]