This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ARMv8, GCC 4.9 and necessary code optimized away?


On 31/05/16 21:37, Jeffrey Walton wrote:
>> 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.

The problem here is that GCC knows that the CRC instructions have
no side effects beyond their operands.  So GCC doesn't generate
the instructions.

> This is at least the third or fourth time. The one prior to this
> resulted in CVE-2016-3995.

Of course GCC deletes dead code.  That's one of the most basic
optimizations.

In your case I'd just use the result as an input operand into an
asm.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]