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

2024-04-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31782

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #15 from Andrew Pinski  ---
Dup of bug 91298 .

*** This bug has been marked as a duplicate of bug 91298 ***

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

2021-08-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31782

Andrew Pinski  changed:

   What|Removed |Added

 CC||greened at obbligato dot org

--- Comment #14 from Andrew Pinski  ---
*** Bug 45591 has been marked as a duplicate of this bug. ***

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

2021-07-29 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31782

Andrew Pinski  changed:

   What|Removed |Added

 CC||kerrg at ccs dot neu.edu

--- Comment #13 from Andrew Pinski  ---
*** Bug 46163 has been marked as a duplicate of this bug. ***

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

2021-07-29 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31782

Andrew Pinski  changed:

   What|Removed |Added

 CC||rwxr-xr-x at gmx dot de

--- Comment #12 from Andrew Pinski  ---
*** Bug 52554 has been marked as a duplicate of this bug. ***

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

2021-07-29 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31782

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2021-07-29
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #11 from Andrew Pinski  ---
Confirmed.

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

2014-06-24 Thread raphael.jakse at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31782

--- Comment #10 from Raphaël JAKSE raphael.jakse at gmail dot com ---
So, a long term solution would be to allow quoted function names with the call
instruction in gas?

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

2014-06-23 Thread raphael.jakse at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31782

--- Comment #8 from Raphaël JAKSE raphael.jakse at gmail dot com ---
I tried
call$

instead of
call($)

With gcc -S, I got :

t.s: Assembler messages:
t.s:30: Error: invalid character `' before operand 1

I don't know if there is a way to use quoting ( ) instead of parenthesizing).

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

2014-06-23 Thread harald at gigawatt dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31782

--- Comment #9 from Harald van Dijk harald at gigawatt dot nl ---
Oh, very sorry about that, I hadn't realised clang stopped using gas. clang
uses its own assembler now, which supports quoted names this as a syntax
extension. Now that there is a possible syntax already, perhaps that will be
easier to bring to gas.

gas does indeed seem to properly handle your suggestion of parenthesised
identifiers on x86-64 already, even if they have names such as $0 (unlike
clang's assembler, oddly). However, I do worry that this may be too brittle,
because of other systems (even using gas) where $ is used more extensively in
standard syntax, such as register names, where parentheses cannot be used to
force interpretation as a symbol name because register names may also be
parenthesised.


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

2014-06-22 Thread raphael.jakse at gmail dot com
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 ($).

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

2014-06-22 Thread harald at gigawatt dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31782

--- Comment #7 from Harald van Dijk harald at gigawatt dot nl ---
That's good to know. Trying some more, clang does manage to get even weirder
symbol names right, because gas does have a form of quoting already, and clang
makes use of it.

int x __asm__());
int main() { return x; }

With clang, this works.

...
movl), %eax
...
.type   ),@object # @)
.comm   ),4,4
...

If it's simpler to implement, then instead of parenthesising, $ could
alternatively be treated as a symbol that needs quoting, which is a more
general solution that will work for any possible symbol name.


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

2011-02-04 Thread funto66 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31782

funto66 at gmail dot com changed:

   What|Removed |Added

 CC||funto66 at gmail dot com

--- Comment #5 from funto66 at gmail dot com 2011-02-04 16:42:33 UTC ---
I think this is the same bug that I got :
- this code compiles :
#include stdio.h
int main(int argc, char* argv[])
{
int $a = 0;
for($a = 0 ; $a  10 ; $a++)
printf(%d\n, $a);

return 0;
}


- this one doesn't :
#include stdio.h
int main(int argc, char* argv[])
{
static const char* $tr = Hello World !\n;
int i=0;

for(;$tr[i] != '\0' ; i++)
fputc($tr[i], stdout);

return 0;
}

Version used: gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)


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

2007-05-02 Thread joseph at codesourcery dot com


--- Comment #4 from joseph at codesourcery dot com  2007-05-02 12:58 ---
Subject: Re:  Invalid assembly code on initial dollar signs

On Wed, 2 May 2007, truedfx at gentoo dot org wrote:

 Thanks for the link. I don't see how GAS could be fixed, though. How would the
 assembler tell the difference between $0 the constant and $0 the identifier?

ELF supports arbitrary (possibly empty) sequences of non-NUL bytes as 
symbol names.  GAS should, in principle, provide an escaping mechanism for 
assembly files to represent all such names.  GCC should use that escaping 
mechanism as required.  (It's arguable whether such escaping should be 
applied to asm names given to variables or whether it's the user's 
responsibility to include the escaping in the string passed to asm in that 
case.)


-- 


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



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

2007-05-01 Thread pinskia at gcc dot gnu dot org


--- Comment #2 from pinskia at gcc dot gnu dot org  2007-05-02 03:33 ---
 unless $ also becomes an invalid identifier in C.

Well read:
http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Dollar-Signs.html

it is can be but does not have to be.

This works for me targetting spu-elf and powerpc64-linux-gnu (with -m32 and
-m64) so this is a target issue.  Really I think this is a bug in binutils for
i386/x86_64 (I can reproduce it there).


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

  Component|c   |target
   GCC host triplet|x86_64-pc-linux-gnu |
 GCC target triplet||x86_64-pc-linux-gnu


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



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

2007-05-01 Thread truedfx at gentoo dot org


--- Comment #3 from truedfx at gentoo dot org  2007-05-02 05:58 ---
Thanks for the link. I don't see how GAS could be fixed, though. How would the
assembler tell the difference between $0 the constant and $0 the identifier?


-- 


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