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



             Bug #: 54796

           Summary: [4.8 Regression] Non-addressable stack parameter debug

                    quality regression

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: debug

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: ja...@gcc.gnu.org

                CC: aol...@gcc.gnu.org

            Target: i686-linux





/* PR debug/NNNNN */

/* { dg-do run } */

/* { dg-options "-g" } */



__attribute__((noinline, noclone)) void

bar (char *a, int b)

{

  __asm volatile ("" : "+r" (a), "+r" (b) : : "memory");

}



__attribute__((noinline, noclone)) void

foo (int a, int b)

{

  int c = a;

  char d[b];/* { dg-final { gdb-test 17 "a" "5" } } */

  bar (d, 2);/* { dg-final { gdb-test 17 "b" "6" } } */

  bar (d, 4);/* { dg-final { gdb-test 17 "c" "5" } } */

}



int

main ()

{

  foo (5, 6);

  return 0;

}



(line 17 is the second call to bar) regressed for -m32 -Os -g on

{i686,x86_64}-linux supposedly with the

http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188871

change.  I've mentioned this already in

http://gcc.gnu.org/ml/gcc-patches/2012-10/msg00262.html

but filing it now on a testcase that is not dependent on any GCC patches.



The problem is that vt_canon_true_dep/canon_true_dependence doesn't figure out

that the stack stores (after prologue where hard fp is initialized) can't alias

argp.  Without the VLA or other reasons forcing use of frame pointer

var-tracking replaces sp accesses with argp + offset accesses and

canon_true_dependence then disambiguates it using the offsets.

Reply via email to