Bug 368412 - False positive result for altivec capability check
Summary: False positive result for altivec capability check
Status: CLOSED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.12 SVN
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-07 17:53 UTC by Carl Love
Modified: 2016-09-14 17:04 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Fix false positive check for altivec support on PPC machines (790 bytes, patch)
2016-09-07 17:57 UTC, Carl Love
Details
updated patch (567 bytes, patch)
2016-09-12 15:50 UTC, Will Schmidt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carl Love 2016-09-07 17:53:36 UTC
An earlier change introduced a think-o in the altivec capability                
check, allowing a false positive if the compiler supported altivec              
but the hardware did not.  

Reproducible: Always

Steps to Reproduce:
1.  Run "make regtest" on power 5 platform
2.
3.

Actual Results:  
Altivec tests run and fail

Expected Results:  
Should correctly detect that altivec support does not exist on the platform and not run the altivec tests
Comment 1 Carl Love 2016-09-07 17:57:13 UTC
Created attachment 100973 [details]
Fix false positive check for altivec support on PPC machines

The attached patch was submitted directly to me from Will Schmidt.  I have reviewed and tested the patch.  It looks fine.  Will post patch to mailing list for community review as it touches the general configure.ac file.
Comment 2 Philippe Waroquiers 2016-09-10 09:38:22 UTC
Comment on attachment 100973 [details]
Fix false positive check for altivec support on PPC machines

Can't really comment on this (autoconf is somewhat mysterious to me) but I guess
this is ok.
Comment 3 Mark Wielaard 2016-09-10 13:08:20 UTC
You are changing the AC_DEFINE from HAS_ALTIVEC to COMPILER_SUPPORTS_ALTIVEC.
But COMPILER_SUPPORTS_ALTIVEC is never used as C preprocessor symbol, so I think you should just remove it.

HAS_ALTIVEC is used as an C preprocessor symbol in none/tests/ppc32/jm-insns.c but there it is defined in the Makefile depending on the AM_CONDITIONAL HAS_ALTIVEC. So that should be fine (although the comment in the code implies it comes from config.h, which isn't true anymore).
Comment 4 Will Schmidt 2016-09-12 15:50:40 UTC
Created attachment 101056 [details]
updated patch

Refreshed the patch per comments and feedback.
Comment 5 Will Schmidt 2016-09-12 15:57:14 UTC
(In reply to Mark Wielaard from comment #3)
> You are changing the AC_DEFINE from HAS_ALTIVEC to COMPILER_SUPPORTS_ALTIVEC.
> But COMPILER_SUPPORTS_ALTIVEC is never used as C preprocessor symbol, so I
> think you should just remove it.

Yup, agreed, done.    Thanks for the review.

> HAS_ALTIVEC is used as an C preprocessor symbol in
> none/tests/ppc32/jm-insns.c but there it is defined in the Makefile
> depending on the AM_CONDITIONAL HAS_ALTIVEC. So that should be fine

Yup, ..  I had added the AM_CONDITIONAL way back in 15424, but I obviously missed removing the old definition, which caused the problem..

> (although the comment in the code implies it comes from config.h, which
> isn't true anymore).
Comment 6 Mark Wielaard 2016-09-13 19:19:20 UTC
Thanks, pushed as valgrind svn r15952
Comment 7 Carl Love 2016-09-14 17:04:34 UTC
Patch has been committed.  Closing.