Re: compilation test fails

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: compilation test fails
Дата
Msg-id 10410.1242916235@sss.pgh.pa.us
обсуждение исходный текст
Ответ на compilation test fails  ("Sofer, Yuval" <Yuval_Sofer@bmc.com>)
Список pgsql-general
"Sofer, Yuval" <Yuval_Sofer@bmc.com> writes:
> I have compiled 8.3.7 on HP-Itanium
> After the build I have continued to the tests (gmake check)
> One of the tests failed (division by zero error test)

Hm, what compiler and what optimization level?  We have seen a report
or two about this before, all from people using gcc on non-mainstream
architectures.  So far as I can tell it's a compiler bug.  The code
in int84div looks like

    int64        arg1 = PG_GETARG_INT64(0);
    int32        arg2 = PG_GETARG_INT32(1);
    int64        result;

    if (arg2 == 0)
        ereport(ERROR,
                (errcode(ERRCODE_DIVISION_BY_ZERO),
                 errmsg("division by zero")));

    result = arg1 / arg2;

and the only way to get the behavior you're showing is if the division
is executing (and causing a trap) before control is passed to ereport().
So apparently the compiler is forgetting that division can have a side
effect (ie machine trap) and thinking it's safe to reorder the
operations.

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Grzegorz Jaśkiewicz
Дата:
Сообщение: Re: fsm on 8.1
Следующее
От: "Keith D. Evans"
Дата:
Сообщение: running postgresql on a private machine accessing it from public web pages