https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31782
Raphaël JAKSE changed:
What|Removed |Added
CC||raphael.jakse at gmail dot com
--- Comment #6 from Raphaël JAKSE ---
New information on this bug:
With gcc version 4.8.3-3 on Debian x86-64 targeting x86_64-linux-gnu, trying to
get the assembly version of the following code with gcc -S:
void $() {}
void a() { $(); }
I get:
[...]
call$
[...]
With clang, I get:
[...]
callq($)
[...]
Making the corresponding object file of this code with gcc -c
- succeed with the assembly code generated by clang
- fails with the assembly code generated by gcc with the following message:
t.c: Assembler messages:
t.c:30: Error: missing or invalid immediate expression `'
Adding parentheses in the assembly code generated by gcc:
call$ → call($)
make the object file generation succeed.
Clang seems to add parentheses whenever the function name starts with a dollar
sign ($).