[Patches] getargs.c

Vladimir Marangozov Vladimir.Marangozov@inrialpes.fr
Sun, 18 Jun 2000 01:37:35 +0200 (CEST)


Trent Mick wrote:
>
> On Sun, Jun 18, 2000 at 12:26:29AM +0200, Vladimir Marangozov wrote:
> >
> > This patch fixes a problem on AIX with the signed int case code in getargs.c
,
> > after Trent Mick's intervention about MIN/MAX overflow checks.  The AIX
> > compiler/optimizer generates bogus code with the default flags "-g -O"
> > causing test_builtin to fail: int("10", 16) <> 16L.
>
> > Hopefully, swapping
> > the two checks in the signed int code makes the problem go away.
> >
> Does it?

Yes, it does. Without optimization, everything was okay, with -O it crashed.
This is the second time that swapping statemets in the code alleviates
bugs in some (old) AIX optimizers. People reported that more recent versions
of the compiler don't show such misbehaviors, but apparently I happen to
use a "buggy" one. Although my system is quite old, I'm not in a hurry
to upgrade as there may be thousands of people like me... So, as far as
such patches don't hurt the semantics of the code, they are fine.

-- 
       Vladimir MARANGOZOV          | Vladimir.Marangozov@inrialpes.fr
http://sirac.inrialpes.fr/~marangoz | tel:(+33-4)76615277 fax:76615252