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

--- Comment #19 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
(In reply to Robin Dapp from comment #18)
> Already in ifcvt we have:
> 
> _ifc__60 = .COND_ADD (_2, _6, MADPictureC1_lsm.10_25,
> MADPictureC1_lsm.10_25);
> 
> which we should not.  This is similar on riscv.
> 
> But during value numbering it still is
> 
> Value numbering stmt = _ifc__60 = .COND_ADD (_47, MADPictureC1_lsm.10_25,
> _6, MADPictureC1_lsm.10_25);
> 
> so we originally created the right thing.
> Hmm, no simplification is happening.  Is there still a swap somewhere that
> should not be?

ADD is commutative, so commutative_op declares COND_ADD as commutative and the
first commutative operand starts at op1.

So swapping _6 and MADPictureC1_lsm.10_25 should be legal to do.  Are you
depending on a specific order?

Reply via email to