copy-symbol: work around a bug in gcc

On x86_64, gcc 12.2.0 from debian 12 miscompiles the code we had
previously. It generates code that copies symbol.macfun and
symbol.sfdef using an aligned move SSE instruction which requires 16
byte alignment of its operand. This alignment is not present in
general, leading to a segfault for instance when calling (copy-symbol
t t). By reordering the assignments, we avoid triggering the bug.
This commit is contained in:
Marius Gerbershagen 2025-06-22 10:32:26 +02:00
parent d880e6f276
commit ea5a10cbc1

View file

@ -335,12 +335,12 @@ cl_symbol_name(cl_object x)
x->symbol.plist = cl_copy_list(sym->symbol.plist);
x->symbol.undef_entry = sym->symbol.undef_entry;
x->symbol.sfdef = sym->symbol.sfdef;
x->symbol.macfun = sym->symbol.macfun;
if (ECL_FBOUNDP(sym)) {
x->symbol.gfdef = sym->symbol.gfdef;
} else {
ECL_FMAKUNBOUND(x);
}
x->symbol.macfun = sym->symbol.macfun;
#ifdef ECL_THREADS
x->symbol.binding = ECL_MISSING_SPECIAL_BINDING;
#endif