Re: [GENERAL] compilation test fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Sofer, Yuval" <Yuval_Sofer@xxxxxxx> 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

-- 
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux