scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit c9781760aaadc50a2b2fcbb7f30ecc74d289d701
parent 6435caae15b88328b6c1d1ef3b8a5b9fbecdd922
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu,  2 Feb 2023 13:20:18 +0100

cc2/qbe: For use of .L in local variables

ELF and COFF use .L for local labels that are not
exported while a.out uses L for them. In the current
QBE state is unlikely that it will support targets
where .L is not accepted for it, and there are some
assemblers that reject local labels that begin with
. and a digit. This commit forces to use .L always
so the lables are going to be safe for any qbe target
supported.

Diffstat:
Msrc/cmd/cc/cc2/target/qbe/code.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/cmd/cc/cc2/target/qbe/code.c b/src/cmd/cc/cc2/target/qbe/code.c @@ -202,13 +202,13 @@ symname(Symbol *sym) case SLOCAL: case SPRIV: case SAUTO: - sprintf(buff, "%c%s.%u", c, sym->name, sym->id); + sprintf(buff, "%c%s.L%u", c, sym->name, sym->id); return buff; default: abort(); } } - sprintf(buff, "%c.%u", c, sym->numid); + sprintf(buff, "%c.L%u", c, sym->numid); return buff; }