[PATCH] reorganize simplify_const_relational_operation

Paolo Bonzini paolo.bonzini@lu.unisi.ch
Wed Sep 19 13:27:00 GMT 2007

Eric Botcazou wrote:
>> The (unsigned HOST_WIDE_INT) cast is needed on the low0 < low1
>> comparison too.
> Not really, look at their type. :-)

Ah, right, if we are comparing -128 (0xFFFFFF80) with 127 (0x0000007F) 
we would already have high0 != high1.  I wonder if it is a bug in 
double_int_scmp, which uses HOST_WIDE_INT for the low part in signed 

>> It's meant to be used elsewhere, where we are only interested in
>> true/false results (not other simplifications).  That's also why it
>> doesn't return FLOAT_STORE_FLAG_VALUE for floats, but only
>> const0/const_true.
> What's the relationship with 'static'?  It's only used in simplify-rtx.c.

API orthogonality.  It's meant to be used elsewhere, it just happens 
that it's not; since we have simplify_const_{un,bin}ary_operation, it is 
reasonable to expect a similar function for relational operations not to 
be static.

In fact, since originally simplify_relational_operation was doing what 
is now known as simplify_const_relational_operation, it might be the 
case that some users could be switched right away.


More information about the Gcc-patches mailing list