128-bit inline assembly addition

Segher Boessenkool segher@kernel.crashing.org
Tue Jul 17 03:12:00 GMT 2018


On Mon, Jul 16, 2018 at 09:52:12PM +0200, Marcel Keller wrote:
> Hi,
> 
> I've found that the attached program, which supposedly adds 1 and 0 as 
> 128-bit numbers using inline assembly, outputs 2^64 + 1 instead when 
> compiled with g++ 7 or 8 and at least -O1. Am I doing something wrong, 

Operand 0 should be marked as earlyclobber.

> or is this a compiler bug?

The answer to that is almost always "no".


Segher



More information about the Gcc-help mailing list