http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47986

           Summary: gcc.c-torture/execute/20040709-1.c fails with
                    non-delegitimized UNSPEC
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: amo...@gmail.com


On powerpc64-linux at -O3 -g -m64, this testcase has the following snippet in
150r.into_cfglayout.  Note the duplicated debug_insns for p (and i).

========
(insn 39 38 40 2 (set (reg:DI 234)
        (plus:DI (reg:DI 2 2)
            (high:DI (const:DI (unspec:DI [
                            (symbol_ref/u:DI ("*.LC5") [flags 0x2])
                        ] 49)))))
/home/alan/src/gcc-current/gcc/testsuite/gcc.c-torture/execute/20040709-1.c:90
517 {largetoc_high}
     (nil))

(insn 40 39 41 2 (set (reg/v/f:DI 209 [ p ])
        (mem/u/c:DI (lo_sum:DI (reg:DI 234)
                (const:DI (unspec:DI [
                            (symbol_ref/u:DI ("*.LC5") [flags 0x2])
                        ] 49))) [6 S8 A8]))
/home/alan/src/gcc-current/gcc/testsuite/gcc.c-torture/execute/20040709-1.c:90
405 {*movdi_internal64}
     (expr_list:REG_EQUAL (const:DI (plus:DI (symbol_ref:DI ("sA") [flags 0x80]
 <var_decl 0xf78492a0 sA>)
                (const_int 1 [0x1])))
        (nil)))

(debug_insn 41 40 42 2 (var_location:DI p (reg/v/f:DI 209 [ p ]))
/home/alan/src/gcc-current/gcc/testsuite/gcc.c-torture/execute/20040709-1.c:90
-1
     (nil))

(debug_insn 42 41 43 2 (var_location:SI i (debug_expr:SI D#16))
/home/alan/src/gcc-current/gcc/testsuite/gcc.c-torture/execute/20040709-1.c:90
-1
     (nil))

(debug_insn 43 42 44 2 (var_location:DI p (reg/v/f:DI 209 [ p ])) -1
     (nil))

(debug_insn 44 43 45 2 (var_location:SI i (debug_expr:SI D#16)) -1
     (nil))
========

In 151r.jump insn 39 and 40 are deleted (reg 209 is dead) and we are left with:

========
(debug_insn 505 38 504 2 (var_location:DI D#21 (plus:DI (reg:DI 2 2)
        (high:DI (const:DI (unspec:DI [
                        (symbol_ref/u:DI ("*.LC5") [flags 0x2])
                    ] 49))))) -1
     (nil))

(debug_insn 504 505 43 2 (var_location:DI D#20 (mem/u/c:DI (lo_sum:DI
(debug_expr:DI D#21)
            (const:DI (unspec:DI [
                        (symbol_ref/u:DI ("*.LC5") [flags 0x2])
                    ] 49))) [6 S8 A8])) -1
     (nil))

(debug_insn 43 504 44 2 (var_location:DI p (debug_expr:DI D#20)) -1
     (nil))

(debug_insn 44 43 45 2 (var_location:SI i (debug_expr:SI D#16)) -1
     (nil))
========

Note how one set of the debug_insns have also been removed, but we are left
with some garbage.  dwarf2out tries to output debug info for p by substituting
the debug_exprs and we get something that rs6000_delegitimize_address can't
handle.

(mem/u/c:DI (lo_sum:DI (plus:DI (reg:DI 2 2)
            (high:DI (const:DI (unspec:DI [
                            (symbol_ref/u:DI ("*.LC11") [flags 0x2])
                        ] 49))))
        (const:DI (unspec:DI [
                    (symbol_ref/u:DI ("*.LC11") [flags 0x2])
                ] 49))) [6 S8 A8])

Reply via email to