[Bug tree-optimization/54200] copyrename generates wrong debuginfo

rguenther at suse dot de gcc-bugzilla@gcc.gnu.org
Tue Jul 12 07:58:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54200

--- Comment #15 from rguenther at suse dot de <rguenther at suse dot de> ---
On Sun, 10 Jul 2016, nightstrike at gmail dot com wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54200
> 
> nightstrike <nightstrike at gmail dot com> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |nightstrike at gmail dot com
> 
> --- Comment #14 from nightstrike <nightstrike at gmail dot com> ---
> (In reply to Richard Biener from comment #10)
> > (In reply to comment #9)
> > > I see following in report for x86:
> > > 
> > > FAIL: gcc.dg/guality/pr54200.c  -O2 -flto -fuse-linker-plugin
> > > -fno-fat-lto-objects  line 20 z == 3
> > 
> > That's what I said in the commit mail.
> 
> Should this be XFAIL then, if it is working as intended in your mind?

Not sure if my analysis is still up-to-date given copyrename is no more
on GCC 6+.  On trunk I see -Os fail on x86_64 and -O2 -flto on i?86.

The testcase was to be a regression test for copyrename which was
removed on GCC 6+.

Note that guality XFAILs tend to be inherently target specific.

Looking at the -Os RTL, the REG attrs seem bogus:

(insn:TI 16 15 17 4 (parallel [
            (set (reg:SI 0 ax [92])
                (plus:SI (reg/v:SI 0 ax [orig:89 z ] [89])
                    (reg/v:SI 4 si [orig:90 x ] [90])))
            (clobber (reg:CC 17 flags))
        ]) 
/space/rguenther/src/svn/trunk/gcc/testsuite/gcc.dg/guality/pr54200.c:19 
211 {*addsi_1}
     (expr_list:REG_DEAD (reg/v:SI 4 si [orig:90 x ] [90])
        (expr_list:REG_UNUSED (reg:CC 17 flags)
            (nil))))

(ok)

(insn:TI 17 16 25 4 (parallel [
            (set (reg/v:SI 0 ax [orig:89 z ] [89])
                (plus:SI (reg:SI 0 ax [92])
                    (reg/v:SI 1 dx [orig:91 b ] [91])))
            (clobber (reg:CC 17 flags))
        ]) 
/space/rguenther/src/svn/trunk/gcc/testsuite/gcc.dg/guality/pr54200.c:19 
211 {*addsi_1}
     (expr_list:REG_DEAD (reg/v:SI 1 dx [orig:91 b ] [91])
        (expr_list:REG_UNUSED (reg:CC 17 flags)
            (nil))))

the destination regdecl is bogus, should be a, not z.

(insn 25 17 38 4 (use (reg/i:SI 0 ax)) 
/space/rguenther/src/svn/trunk/gcc/testsuite/gcc.dg/guality/pr54200.c:22 
-1
     (nil))
(note 38 25 33 4 NOTE_INSN_EPILOGUE_BEG)
(jump_insn:TI 33 38 34 4 (simple_return) 
/space/rguenther/src/svn/trunk/gcc/testsuite/gcc.dg/guality/pr54200.c:22 
697 {simple_return_internal}

When single-stepping through foo locals show various bougs debug-info
values but I guess that is kind-of expected without VTA.

The above shows that while copyrename was fixed to not assign
a bogus decl to the PHI result later RTL expansion will do the
same mistake again (by means of out-of-SSA coalescing), which
-fno-tree-coalesce-vars fixes, but then later when the
single return is split somehow bogus information is constructed
for debugging.

I suggest to open a new bugreport for this.


More information about the Gcc-bugs mailing list