This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: ARMv8, GCC 4.9 and necessary code optimized away?
- From: Jeffrey Walton <noloader at gmail dot com>
- To: Kyrill Tkachov <kyrylo dot tkachov at foss dot arm dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Tue, 31 May 2016 16:37:47 -0400
- Subject: Re: ARMv8, GCC 4.9 and necessary code optimized away?
- Authentication-results: sourceware.org; auth=none
- References: <CAH8yC8=KPf7edhTRgKV4nVJfwMpSXwmU+PDGfL6i4xA4SDwJwQ at mail dot gmail dot com> <574D89F2 dot 70108 at foss dot arm dot com>
- Reply-to: noloader at gmail dot com
> Like Florian said, 'w' is not being used so the compiler may optimise the
> whole sequence away.
I'm pretty sure this is another instance of a language defect. The
C/C++ language does not allow us to properly express ourselves, and
the result is the removal of critical code.
This is at least the third or fourth time. The one prior to this
resulted in CVE-2016-3995.
> On a side note, if you want to detect the availability of certain extensions
> at runtime have you considered using the hwcaps mechanism?
>
> https://community.arm.com/groups/android-community/blog/2014/10/10/runtime-detection-of-cpu-features-on-an-armv8-a-cpu
Yes, I tired that first. Its not as portable as I hoped. It mostly
worked on Linux, but not iOS and a couple other platforms. Its also
missing constants on Linux for Aarch32 execution environments on
Aarch64.
Jeff