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

           Summary: pr47201: var-tracking loc_order_check fails for type
                    punning examples
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: kreb...@gcc.gnu.org


Created attachment 23593
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23593
pr47201.i.214r.vartrack

The pr47201 testcase contains a union of an int and a float value.
The way these values are accessed seems to confuse the
canonicalize_loc_order_check done during var-tracking.

/build3/gcc-head/gcc/testsuite/gcc.dg/pr47201.c: In function ‘foo’:
/build3/gcc-head/gcc/testsuite/gcc.dg/pr47201.c:18:1: internal compiler error:
in loc_cmp, at var-tracking.c:2753
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


pr47201.i.212r.alignments:

(insn 29 10 11 2 (set (reg:SI 1 %r1)
        (mem/u/c:SI (plus:SI (reg:SI 12 %r12)
                (const:SI (unspec:SI [
                            (symbol_ref:SI ("u")  <var_decl 0x779eb060 u>)
                        ] 111))) [0 S4 A8]))
            /build3/gcc-head/gcc/testsuite/gcc.dg/pr47201.c:17 67 {*movsi_esa}
     (nil))

(insn 11 29 30 2 (set (reg:SF 16 %f0 [orig:53 u.d ] [53])
        (mem/s/j/c:SF (reg:SI 1 %r1) [0 u.d+0 S4 A32]))
    /build3/gcc-head/gcc/testsuite/gcc.dg/pr47201.c:17 87 {movsf}
     (expr_list:REG_DEAD (reg:SI 1 %r1)
        (expr_list:REG_EQUIV (mem/s/j/c:SF (mem/u/c:SI (plus:SI (reg:SI 12
%r12)
                        (const:SI (unspec:SI [
                                    (symbol_ref:SI ("u")  <var_decl 0x779eb060
u>)
                                ] 111))) [0 S4 A8]) [0 u.d+0 S4 A32])
            (nil))))

(insn 30 11 12 2 (set (reg:SF 17 %f2)
        (mem/u/c:SF (plus:SI (reg:SI 12 %r12)
                (const:SI (unspec:SI [
                            (symbol_ref:SI ("u")  <var_decl 0x779eb060 u>)
                        ] 111))) [0 S4 A8]))
            /build3/gcc-head/gcc/testsuite/gcc.dg/pr47201.c:17 87 {movsf}
     (expr_list:REG_DEAD (reg:SI 12 %r12)
        (nil)))

(insn 12 30 13 2 (set (reg:CCZ 33 %cc)
        (compare:CCZ (reg:SF 16 %f0 [orig:53 u.d ] [53])
            (reg:SF 17 %f2)))
        /build3/gcc-head/gcc/testsuite/gcc.dg/pr47201.c:17 49 {*cmpsf_ccs}
     (expr_list:REG_DEAD (reg:SF 17 %f2)
        (expr_list:REG_DEAD (reg:SF 16 %f0 [orig:53 u.d ] [53])
            (nil))))


log_cmp complains about the mode differences of:

(reg:SF 17 %f2)
(reg:SI 1 %r1)

both holding: (symbol_ref:SI ("u")  <var_decl 0x779eb060 u>)

from:

(value/u:SI 12:5945 @0xe15b28/0xe27910)
 locs:
  from insn 30 (reg:SF 17 %f2)
  from insn 29 (reg:SI 1 %r1)
  from insn 29 (symbol_ref:SI ("u")  <var_decl 0x779eb060 u>)
 addr list:
  (value/u:SF 14:14 @0xe15b58/0xe27950)

Reply via email to