This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: INT_MIN % -1
- From: Paul Schlie <schlie at comcast dot net>
- To: Robert Dewar <dewar at gnat dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Tue, 30 Nov 2004 22:21:52 -0500
- Subject: Re: INT_MIN % -1
> 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?