Re: pgsql: Provide overflow safe integer math inline functions.

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Provide overflow safe integer math inline functions.
Date: 2017-12-17 07:00:31
Message-ID: CAB7nPqS-T=GgEHX6aEAk_2X5B9uAUJgDOxHU5u1PkQfV1iuLjA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Sun, Dec 17, 2017 at 9:32 AM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> I've since tried this via the buildfarm, but still:
>
> configure:14480: checking for __builtin_mul_overflow
> configure:14500: ccache clang -o conftest -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -g -O2 -D_GNU_SOURCE -I/usr/include/et conftest.c -lssl -lcrypto -lz -lreadline -lrt -lcrypt -ldl -lm >&5
> configure:14500: $? = 0
> configure:14508: result: yes
>
> I'm not quite following. Could you check if the same happens without
> -O2? Not because that'd be a solution, but to narrow down how this
> happens?

I have triggered a new test manually this morning on dangomushi
because I knew that it would fail as I have tested as well stuff
similar to the version you have pushed. Please note that if you added
a volatile cast to "result" as well, then compilation was able to
complete and regression tests passed...
--
Michael

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-12-17 16:03:49 Re: pgsql: Provide overflow safe integer math inline functions.
Previous Message Tom Lane 2017-12-17 05:42:20 pgsql: Suppress compiler warning about no function return value.

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2017-12-17 10:29:10 Re: [HACKERS] Proposal: Local indexes for partitioned table
Previous Message Andres Freund 2017-12-17 04:42:49 Re: Protect syscache from bloating with negative cache entries