INT_MIN % -1
Paul Schlie
schlie@comcast.net
Wed Dec 1 03:22:00 GMT 2004
> From: Robert Dewar <dewar@gnat.com>
>
> Paul Schlie wrote:
>> With reference to the below:
>>
>> I would guess that rather than attempting to expose a check for a / or % by
>> -1 to the compiler, I would assume that it's best handled by the back end
>> during code generations, as the most efficient solution is target specific:
>
> Indeed, but remember we would need to have both operations, one with the
> special handling and one without.
Understood, as ADA programs may bound the domain of it's variables
guaranteeing that the operation would be well behaved within the bounds of
it's operands; but wonder if saving a few cycles out of the likely several
required for a divide or modulo operation would likely be worth the added,
albeit minor, complexity?
More information about the Gcc
mailing list