[Bug c/126552] const-qualified local register variable used as an asm operand is silently discarded

bernie at codewiz dot org via Gcc-bugs <[email protected]> Sat, 01 Aug 2026 03:27:28 +0000
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126552

--- Comment #3 from Bernie Innocenti <bernie at codewiz dot org> ---
I implemented the suggestion of using hard register constraints directly in my
codebase as a temporary hack while discussing the fix with the amiga-gcc
maintainers:

https://github.com/codewiz/p96cts/commit/5f01d432ef31cf4bf562b144da14ee8e373400d4

 - GCC 16.1: Works and fixes my miscompilation
 - GCC 15.2: The "+{reg}" read-write form is unsupported (error: matching
constraint not valid in output operand)
 - GCC 13.4: No -mlra