https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110126
Bug ID: 110126
Summary: Variables are reported as unused when only referenced
by ASM statements
Product: gcc
Version: 13.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: modula2
Assignee: gaius at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
In the following fragment:
MODULE foo;
VAR x: INTEGER;
PROCEDURE test;
BEGIN
ASM("" : : "m"(x));
END test;
END foo.
x is reported as unused (same happens when specifying it as output parameter)
Even worse, when used as input operand only, the whole asm statement seems to
be optimized away.