This is the mail archive of the gcc@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: [RFH] Uses of output.h in the front ends


On Mon, Jun 4, 2012 at 4:52 PM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Mon, Jun 4, 2012 at 4:50 PM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
>> On Mon, Jun 4, 2012 at 3:34 PM, Richard Guenther
>> <richard.guenther@gmail.com> wrote:
>>>> first_global_object_name:
>>>> ada/gcc-interface/trans.c: ?first_global_object_name = ggc_strdup
>>>> (IDENTIFIER_POINTER (t));
>>>> ada/gcc-interface/utils.c: ? ? ?ASM_FORMAT_PRIVATE_NAME (label,
>>>> first_global_object_name, 0);
>>>>
>>>> This comes from here:
>>>>
>>>> ?/* Declare the name of the compilation unit as the first global
>>>> ? ? name in order to make the middle-end fully deterministic. ?*/
>>>> ?t = create_concat_name (Defining_Entity (Unit (gnat_root)), NULL);
>>>> ?first_global_object_name = ggc_strdup (IDENTIFIER_POINTER (t));
>>>>
>>>> Only the Ada front end has code like this. The other front ends set
>>>> first_global_object_name via notice_global_symbol (which is called
>>>> from varpool_finalize_decl and a few other places). It seems like a
>>>> good idea to me, to make first_global_object_name deterministic.
>>>> Perhaps it should be set to the top level translation unit by all
>>>> front ends? That would also simplify notice_global_symbol and prevent
>>>> it from accessing/creating DECL_RTL early.
>>>>
>>>>
>>>> user_label_prefix:
>>>> c-family/c-cppbuiltin.c: ?builtin_define_with_value
>>>> ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
>>>>
>>>> Because user_label_prefix is defined in toplev.c, I think its global
>>>> decl should be moved from output.h to toplev.h.
>>>
>>> Sounds reasonable.
>>>
>>>>
>>>> asm_out_file for ASM_OUTPUT_IDENT:
>>>> c-family/c-lex.c:#include "output.h" /* for asm_out_file */
>>>> c-family/c-lex.c: ? ? ? ? ASM_OUTPUT_IDENT (asm_out_file, (const char
>>>> *) cstr.text);
>>>> ada/gcc-interface/trans.c: ? ? ?(asm_out_file,
>>>>
>>>> I am not sure how to fix this. Maybe also write this out via a version
>>>> of build_constant_desc that puts the data in a specific section (that
>>>> would be required for MIPS' version of ASM_OUTPUT_IDENT).
>>>
>>> Hm. ?The docs for -fno-ident say
>>>
>>> @item -fno-ident
>>> @opindex fno-ident
>>> Ignore the @samp{#ident} directive.
>>>
>>> And the CPP docs:
>>>
>>> @findex #ident
>>> @findex #sccs
>>> The @samp{#ident} directive takes one argument, a string constant. ?On
>>> some systems, that string constant is copied into a special segment of
>>> the object file. ?On other systems, the directive is ignored. ?The
>>> @samp{#sccs} directive is a synonym for @samp{#ident}.
>>>
>>> I suppose make ASM_OUTPUT_IDENT a target hook instead.
>>
>> This doesn't really help: You'd now have a target hook called from the
>> front end that writes to asm_out_file. I want front ends to stop
>> writing to asm_out_file at all.
>
> I mean make the whole "write #ident" a target hook.

Another possibility would be to generate a toplevel asm at this point ...

Richard.


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