[Bug c/126552] const-qualified local register variable used as an asm operand is silently discarded
"jakub at gcc dot gnu.org via Gcc-bugs" <[email protected]> Mon, 03 Aug 2026 10:02:03 +0000
| Newsgroups | gmane.comp.gcc.bugs |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D126552 --- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- That is a user error. For C++ the language requires such handling of const variables initialized with constant expressions, for C allows it. So, if y= ou don't want that behavior, either drop the const keyword in those cases, or = for GCC 16+ use the hard register constraints.=