[Bug inline-asm/70184] Explicit register variables holding function arguments overwritten by conversion libcall

ktkachov at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Mar 11 10:07:00 GMT 2016


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

--- Comment #3 from ktkachov at gcc dot gnu.org ---
(In reply to Andrew Pinski from comment #2)
> Does -fno-ter fix the issue?
> How does the tree level look?

You mean -fno-tree-ter?
That gives:
foo:
        @ args = 0, pretend = 0, frame = 0
        @ frame_needed = 0, uses_anonymous_args = 0
        push    {r4, lr}
        mov     r4, r0
        mov     r0, r1
        bl      __aeabi_f2uiz
        mov     r1, r0
        mov     r0, r4
        .syntax divided
@ 7 "foo.c" 1
        str r1, [r0]

@ 0 "" 2
        .syntax unified
        pop     {r4, pc}

Which looks correct, thanks!

The optimized tree dump looks right to me with or without -fno-tree-ter

;; Function foo (foo, funcdef_no=0, decl_uid=4090, cgraph_uid=0,
symbol_order=0)

foo (unsigned int a, float b)
{
  register unsigned int r1 __asm__ (*r1);
  register unsigned int r0 __asm__ (*r0);
  unsigned int c;

  <bb 2>:
  c_2 = (unsigned int) b_1(D);
  r0 = a_4(D);
  r1 = c_2;
  __asm__ __volatile__("str %1, [%0]
" :  : "r0" "r" r0, "r1" "r" r1);
  return;

}


More information about the Gcc-bugs mailing list