This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bug in divmodhi4(), plus poor inperformant code
- From: Paul Koning <paulkoning at comcast dot net>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: Stefan Kanthak <stefan dot kanthak at nexgo dot de>, gcc at gcc dot gnu dot org
- Date: Wed, 5 Dec 2018 12:24:35 -0500
- Subject: Re: Bug in divmodhi4(), plus poor inperformant code
- References: <08C1AE242031402FA1206D72CB9AD084@W340> <E9204D74-DF3F-4D0F-AA5D-197B0758DDDC@comcast.net> <58F21FB4419D43EEBBBF13235B24E9C6@W340> <20181205162301.GP3803@gate.crashing.org>
> On Dec 5, 2018, at 11:23 AM, Segher Boessenkool <segher@kernel.crashing.org> wrote:
>
> On Wed, Dec 05, 2018 at 02:19:14AM +0100, Stefan Kanthak wrote:
>> "Paul Koning" <paulkoning@comcast.net> wrote:
>>
>>> Yes, that's a rather nasty cut & paste error I made.
>>
>> I suspected that.
>> Replacing
>> !(den & (1L<<31))
>> with
>> (signed short) den >= 0
>> avoids this type of error: there's no need for a constant here!
>>
>> JFTR: of course the 1L should be just a 1, without suffix.
>
> "int" can be 16 bits only, I think? If you change to 15 you can remove
> the L, sure.
"int" on pdp11 is either 16 or 32 bits depending on switches, but "short int" is always 16. I changed it to be 1U << 15 which seems more appropriate if int is 16 bits.
paul