This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/31782] Invalid assembly code on initial dollar signs


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31782

RaphaÃl JAKSE <raphael.jakse at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |raphael.jakse at gmail dot com

--- Comment #6 from RaphaÃl JAKSE <raphael.jakse at gmail dot com> ---
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 ($).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]