On Wed, Mar 17, 2010 at 5:51 PM, Richard Guenther
<richard.guent...@gmail.com> wrote:
> On Wed, Mar 17, 2010 at 5:32 PM, Jakub Jelinek <ja...@redhat.com> wrote:
>> On Wed, Mar 17, 2010 at 12:06:49PM -0400, Aldy Hernandez wrote:
>>> What happens is that rtl_for_decl_location():dwarf2out.c will call
>>> make_decl_rtl() which further down the call chain will call
>>> get_alias_set/new_alias_set.  It matters not that we reset DECL_RTL
>>> immediately after, we have already created a new alias set for first
>>> time callers:
>>>
>>>   /* Try harder to get a rtl.  If this symbol ends up not being emitted
>>>      in the current CU, resolve_addr will remove the expression referencing
>>>      it.  */
>>> ...
>>> ...
>>>     {
>>>       rtl = DECL_RTL (decl);
>>>       /* Reset DECL_RTL back, as various parts of the compiler expects
>>>        DECL_RTL set meaning it is actually going to be output.  */
>>>       SET_DECL_RTL (decl, NULL);
>>
>> expand_debug_expr is another such spot.
>> I guess best would be to make sure no new alias set is created in these
>> places.  Perhaps
>> int save_strict_aliasing = flag_strict_aliasing;
>> flag_strict_aliasing = 0;
>> rtl = DECL_RTL (decl);
>> flag_strict_aliasing = save_strict_aliasing;
>> in both places?
>> The rtls created this way are used only for DEBUG purposes.
>> I bet C/C++ FEs create the alias set for the decls much earlier...
>
> Ugh.  I'd rather simply drop alias-sets from compare-debug dumps.
>
> But ..
>
>     rtl = DECL_RTL (decl);
>     /* Reset DECL_RTL back, as various parts of the compiler expects
>        DECL_RTL set meaning it is actually going to be output.  */
>     SET_DECL_RTL (decl, NULL);
>
> ... why do this in the first place?  Is this an issue for all decls or just
> for DEBUG_DECLs?  For DEBUG_DECLs you could refuse to assign
> alias-sets in get_alias_set by returning 0 for them.

It seems to me that code-path is from before we forced unit-at-a-time
compile and now should only trigger for statics we do not emit
(and debug-decls?).  Why not simply remove it alltogether?

Richard.

>
> Richard.
>
>>        Jakub
>>
>

Reply via email to