<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hi All,</div>
<div>I would expect the x2 argument register to be saved and restored when used beyond an asm block. The movs between x2 and x19 oddly seem to be in the wrong direction. Register x19 is later used with an unexpected value and the program segfaults. Is this a bug or the expected behaviour? The architecture is aarch64.</div>
<div><br/>
...</div>
<div> 44cdc: aa1303e2 mov x2, x19<br/>
44ce0: f9401850 ldr x16, [x2,#48]<br/>
44ce4: 91002051 add x17, x2, #0x8<br/>
44ce8: f9000bf6 str x22, [sp,#16]<br/>
44cec: 90000041 adrp x1, 4c000 <...+0x2c94><br/>
------volatile asm block with x2, x17 as inputs, x16 as output---------<br/>
----------------------------------------------------------------------------------<br/>
44d14: f0000154 adrp x20, 6f000 <...+0x10><br/>
44d18: f947a294 ldr x20, [x20,#3904]<br/>
44d1c: 913d8021 add x1, x1, #0xf60<br/>
44d20: aa0203f3 mov x19, x2 <----- is x2 valid here? <br/>
44d24: f9400280 ldr x0, [x20]<br/>
44d28: 97ffa866 bl 2eec0 <_Z8dfprintfP8_IO_FILEPKcz> <---- x2 is also argument3<br/>
...</div>
<div> </div>
<div>Thanks,</div>
<div>Alex</div></div></body></html>