Re: PostgreSQL 8.1.5: regression tests fail on sparc - Mailing list pgsql-bugs

From Tom Lane
Subject Re: PostgreSQL 8.1.5: regression tests fail on sparc
Date
Msg-id 27188.1164405969@sss.pgh.pa.us
Whole thread Raw
In response to PostgreSQL 8.1.5: regression tests fail on sparc  (Дейтер Александр Валериевич <tiamat@komi.mts.ru>)
List pgsql-bugs
Дейтер Александр Валериевич <tiamat@komi.mts.ru> writes:
> PostgreSQL 8.1.5 have a problem with division by zero on sparc.
> Solaris 9 sparc, gcc 4.0.2, 4.1.1:

We've not heard that reported before, so I wonder whether there's not
something broken about your compiler or libc.

The code in question is in int2div() in utils/adt/int.c:
   if (arg2 == 0)       ereport(ERROR,               (errcode(ERRCODE_DIVISION_BY_ZERO),
errmsg("divisionby zero"))); 
   result = arg1 / arg2;

It's a bit hard to see how a compiler could get this wrong, but maybe
it's thinking it can evaluate the division before calling errfinish?
        regards, tom lane


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #2779: Making an inherited table to a view causes could not open relation error in base table
Next
From: tomas@tuxteam.de
Date:
Subject: Re: BUG #2776: unable to access created user directory