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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Can be also reproduced with
void bar (int, int, int, int, int, int, int, int, int, int, int, int *);

int
foo (int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int
k)
{
  int z[64];
  if (a > 37)
    bar (a, b, c, d, e, f, g, h, i, j, k, z);
  if (__builtin_expect (b, 0))
    bar (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0);
  return a + b + c;
}

The difference at -O2 -g -dA in the assembly is (when ignoring debug info):
        # DEBUG g => [argp]
        # DEBUG k => [argp+0x20]
        # DEBUG j => [argp+0x18]
        # DEBUG a => di
        # DEBUG b => si
        # DEBUG c => dx
        # DEBUG d => cx
        # DEBUG h => [argp+0x8]
        # DEBUG e => r8
        # DEBUG i => [argp+0x10]
        # DEBUG f => r9
...
 .LVL4:
+       # DEBUG h => [sp+0x10]
+       # DEBUG i => [sp+0x18]
+       # DEBUG j => [sp+0x20]
+       # DEBUG k => [sp+0x28]
        # DEBUG c => entry_value
 # SUCC: EXIT [always]  count:1073741824 (estimated locally)
        ret
 .LVL5:
+       # DEBUG k => [argp+0x20]
        # DEBUG a => bx
        # DEBUG b => si
        # DEBUG c => dx
        # DEBUG d => cx
        # DEBUG e => r8
        # DEBUG f => r9
+       # DEBUG h => [argp+0x8]
+       # DEBUG i => [argp+0x10]
+       # DEBUG j => [argp+0x18]
i.e. at the end of epilogue we don't find the argp equivalence for some reason,
which means we unnecessarily use location list when it is something that can be
expressed directly in the DIEs.  Will have a look tomorrow.

Reply via email to