pgsql: Improve configure test for the sse4.2 crc instruction.

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve configure test for the sse4.2 crc instruction.
Date: 2015-08-17 09:36:11
Message-ID: E1ZRGpv-0006Vr-7h@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Improve configure test for the sse4.2 crc instruction.

With optimizations enabled at least one compiler, clang 3.7, optimized
away the crc intrinsics knowing that the result went on unused and has
no side effects. That can trigger errors in code generation when the
intrinsic is used, as we chose to use the intrinsics without any
additional compiler flag. Return the computed value to prevent that.

With some more pedantic warning flags (-Wold-style-definition) the
configure test failed to recognize the existence of _mm_crc32_u*
intrinsics due to an independent warning in the test because the test
turned on -Werror, but that's not actually needed here.

Discussion: 20150814092039(dot)GH4955(at)awork2(dot)anarazel(dot)de
Backpatch: 9.5, where the use of crc intrinsics was integrated.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/2c5c11ae9e0c5f4605fb9cdd2e8bd94fe0a06d95

Modified Files
--------------
config/c-compiler.m4 | 7 +++----
configure | 10 ++++------
2 files changed, 7 insertions(+), 10 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2015-08-17 09:55:20 pgsql: docs: Fix "typo" introduced in 3f811c2d.
Previous Message Andres Freund 2015-08-17 09:36:09 pgsql: Improve configure test for the sse4.2 crc instruction.