stefan-sf-ibm wrote:

> Thanks for all the comments. I think from @stefan-sf-ibm's response, it 
> sounds like the GCC side is not fully decided on what to do with multiple 
> constraints involving hard registers, so we can wait for the details to be 
> hashed out further there.

Since GCC is in a late development stage I decided to postpone this to a future 
GCC release. In order to prevent subtle bugs, I reject multiple hard register 
constraints as well as a combination of hard register constraints and regular 
register constraints in one alternative in this 
[commit](https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=804912edbfc93b6f68869aff736eec159423fd43)
 which will land for GCC 16.

> A register-asm variable declaration passed to an asm statement should 
> definitely override the constraints listed on the asm statement itself, 
> forcing the use of the specified register. Doing otherwise is extremely 
> surprising behavior! That said, it'd (probably) be OK to report a compiler 
> error if the constraints listed on the asm statement would not otherwise 
> permit the listed register. (But such a behavior change is pretty much 
> unrelated to this PR)

This is different for GCC where the constraint wins. Basically the register asm 
materializes for RTL into hard register assignments and during register 
allocation the operand is assigned a register according to the constraint 
possibly resulting in reloads. My gut feeling is that this was not intended but 
rather a side effect of the implementation. From a user perspective an error 
would be probably more appropriate since this sounds like a subtle bug.

https://github.com/llvm/llvm-project/pull/85846
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to