[PATCH] simplify-rtx: Fix compare of comparisons (PR60818)

Segher Boessenkool segher@kernel.crashing.org
Mon Apr 3 17:19:00 GMT 2017


On Mon, Apr 03, 2017 at 11:01:23AM -0600, Jeff Law wrote:
> >	PR rtl-optimization/60818
> >	* simplify-rtx.c (simplify_binary_operation_1): Do not replace
> >	a compare of comparisons with the thing compared if this results
> >	in a different machine mode.
> >
> >gcc/testsuite/
> >	PR rtl-optimization/60818
> >	* gcc.c-torture/compile/pr60818.c: New testcase.
> Doesn't seem like a regression.  But I can't see how it could possibly 
> result in any correctness issues -- the absolute worst would be a 
> performance issue and even that seems highly unlikely.

It ICEs with trunk, it didn't ICE with 6.

The problem is that changing the mode of the CC in the producer, while
not changing the mode in the consumer, is very wrong, and runs into
asserts later on.

> OK for the trunk if you think it's worth fixing for gcc-7.  Else it's 
> pre-approved for gcc-8.

I'll commit it then.  Thanks,


Segher



More information about the Gcc-patches mailing list