[Bug c/65784] New: after reload, the memrefs_conflict_p is unreliable?

wangjiefeng at huawei dot com gcc-bugzilla@gcc.gnu.org
Thu Apr 16 06:00:00 GMT 2015


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

            Bug ID: 65784
           Summary: after reload, the memrefs_conflict_p is unreliable?
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: wangjiefeng at huawei dot com

int f = -1;
int foo(int * pa)
{
  int a = 1;
  *(pa) = a;
  pa = pa + f;
  a = *(pa + 1);
  return a;
}

With -O2, the ARM's assembler is as follows:
foo:
        @ args = 0, pretend = 0, frame = 0
        @ frame_needed = 0, uses_anonymous_args = 0
        @ link register save eliminated.
        movw    r3, #:lower16:.LANCHOR0 @ 20    *arm_movsi_insn/4       [length
= 4]
        mov     r2, #1  @ 6     *arm_movsi_insn/2       [length = 4]
        movt    r3, #:upper16:.LANCHOR0 @ 21    *arm_movt       [length = 4]
        str     r2, [r0]        @ 7     *arm_movsi_insn/6       [length = 4]
        ldr     r3, [r3]        @ 9     *arm_movsi_insn/5       [length = 4]
        add     r0, r0, r3, asl #2      @ 11    *arith_shiftsi/1        [length
= 4]
        ldr     r0, [r0, #4]    @ 17    *arm_movsi_insn/5       [length = 4]
        bx      lr      @ 26    *arm_return     [length = 12]
        .size   foo, .-foo
        .global f
        .data
        .align  2

In sched1, insn 7 and insn 17 has true dependence, but in sched2, the true
dependence between insn 7 and insn 17 is omitted.
It seems after reload, in function true_dependence_1, the memrefs_conflict_p is
unreliable?



More information about the Gcc-bugs mailing list