Re: BUG #4190: sparc64 test suite fails - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #4190: sparc64 test suite fails
Date
Msg-id 19376.1211569774@sss.pgh.pa.us
Whole thread Raw
In response to BUG #4190: sparc64 test suite fails  ("Dennis Gilmore" <dennis@ausil.us>)
Responses Re: BUG #4190: sparc64 test suite fails  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-bugs
"Dennis Gilmore" <dennis@ausil.us> writes:
> errors test fails.  the following is the output.  which to me indicates it
> passed  but gave different output.

No, it failed.  The code in question looks like this:

    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 output you are showing indicates that the compiler thought it
could rearrange the code so that the division was executed *despite*
the protective test in front of it.

IMHO, what you have here is a compiler bug, or at least the gcc boys are
going to need to provide a damn good excuse why it's not.

BTW, kindly revert the patch you inserted in the Fedora repository.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Martin Saschek"
Date:
Subject: BUG #4191: Include hint for Windows-like locals in documentation
Next
From: Gregory Stark
Date:
Subject: Re: BUG #4190: sparc64 test suite fails