[PATCH][combine][obvious] Use std::swap instead of manually swapping

Jeff Law law@redhat.com
Mon Apr 27 16:07:00 GMT 2015


On 04/27/2015 08:37 AM, Segher Boessenkool wrote:
> On Mon, Apr 27, 2015 at 10:55:17AM +0100, Kyrill Tkachov wrote:
>> Precedents suggest these changes are considered obvious.
>> So I'll commit this in a couple of days unless someone objects.
>
> Yes it's obvious.  One tiny thing...
>
>> @@ -9062,7 +9061,7 @@ known_cond (rtx x, enum rtx_code cond, rtx reg, rtx val)
>>     else if (COMPARISON_P (x) || COMMUTATIVE_ARITH_P (x))
>>       {
>>         if (rtx_equal_p (XEXP (x, 0), val))
>> -	cond = swap_condition (cond), temp = val, val = reg, reg = temp;
>> +	cond = swap_condition (cond), std::swap (val, reg);
>>
>>         if (rtx_equal_p (XEXP (x, 0), reg) && rtx_equal_p (XEXP (x, 1), val))
>>   	{
>
> Might as well write this as two statements, like everywhere else, e.g.
Agreed.  I really dislike using ',' like is shown above from a 
readability standpoint.

jeff



More information about the Gcc-patches mailing list