This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR42631] merge uninitialized refs into a single web
On Fri, Jan 8, 2010 at 10:28 AM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
> On Fri, Jan 8, 2010 at 10:01 AM, Alexandre Oliva <aoliva@redhat.com> wrote:
>> Web doesn't combine references to uninitialized registers into a single
>> web, introducing a new pseudo for each such reference. ?This can be
>> wasteful (imagine multiple such references, each getting its own
>> register or stack slot!), and it also causes -fcompare-debug failures,
>> because uninitialized references may show up in debug insns, getting
>> registers out of sync, possibly causing codegen differences.
>>
>> The reason web doesn't combine references is that DF doesn't make them
>> part of the same UD chain. ?This could be fixed in DF, introducing
>> artificial DEFs for registers used uninitialized, but since we're
>> talking about undefined behavior here, it's probably better to limit the
>> cost of dealing with this issue, taking care of it on an as-needed
>> basis.
>>
>> This patch fixes web.c so as to combine chain-less webs, avoiding the
>> waste and the -fcompare-debug failure.
>>
>> Ok to install if it regstraps?
>
> Hi Alexandre,
>
> Could you please not do this part:
>
> ? ? ? ?* df.h (unionfind_root, unionfind_union, union_defs): Removed.
> ? ? ? ?(struct web_entry): Moved...
>
> IMHO we should still fix the SEE pass properly somewhen (maybe for GCC
> 4.6?) and that pass needs these bits in df.h instead of web.c.
>
> But if it's decided to move these bits back to web.c anyway, then
> please also remove the function parameter from union_defs -- it always
> calls unionfind_union in web.c.
>
> What do you think about this TODO from web.c:
>
> ? TODO
> ? ?- Add code to keep debugging up-to-date after splitting user variable
> ? ? ?pseudos. ?This can be done by keeping track of all the pseudos used
> ? ? ?for the variable and using life analysis information before reload
> ? ? ?to determine which one is live and, in case more than one are live,
> ? ? ?choose the one with the latest definition.
>
> Is that now fixed if var-tracking is enabled?
>
> The approach you take to fixing this bug looks good to me (not that I
> can approve the patch... ;-).
The patch is ok if you drop the moving stuff around. I also wonder why
you change the type of 'used'? We seem to be using arrays of chars
for flags everywhere else.
Thanks,
Richard.
> Could you please see if this also fixes bug 42642?
>
> Thanks,
>
> Ciao!
> Steven
>