This is the mail archive of the gcc-patches@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]

Re: [patch][PCH] Do not write/read asm_out_file


On Wed, Jun 6, 2012 at 7:15 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
> Il 06/06/2012 09:15, Steven Bosscher ha scritto:
>> + ? ?add_asm_printf ("%s\n\t.ascii \"%s\"\n",
>> + ? ? ? ? ? ? ? ? READONLY_DATA_SECTION_ASM_OP, string);
>> + ?else
>
> Need to escape the string as in mips_output_ascii, of course. :(

Well, I suppose so...
But I was wondering why mips writes out ident strings as ascii in the
first place.

The GCC version string is output as .ident with "normal" quoting, but
a user #ident is printed out as a .ascii. It has been like that since
the initial revision (r297, more than 20 years ago). See example at
the bottom of this mail (some test case in the test suite, but I don't
remember which one).

Shouldn't we just print out .ident for #ident? That would make things
a lot easier for me, at least :-)
Richard S.?

Ciao!
Steven



typedef char *ident;
#ident "This is ident"
ident i;

==>

        .file   1 "t.c"
        .section .mdebug.abi32
        .previous
        .gnu_attribute 4, 1
        .rdata
        .ascii  "This is ident\000"

        .comm   i,4,4
        .ident  "GCC: (GNU) 4.8.0 20120604 (experimental) [trunk
revision 188182]"


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