On Wed, Jun 22, 2016 at 11:21:44AM +0200, Eric Botcazou wrote:
> > Ok, even for branches I think, but would be nice to have a corresponding
> > guality testcase (perhaps just for -O0 with dg-skip-if) which fails without
> > this patch and succeeds with it.
> 
> Thanks.  The failure mode is that the offset from VIRTUAL_STACK_VARS_REGNUM 
> is 
> too large so, on RISC architectures, it is not legitimate and the address is 
> rewritten.  Can this me mimiced on x86?

The testcase doesn't necessarily need to FAIL without the patch on x86, it
is fine if it fails on some PowerPC* or Visium.
I'd expect something like:

/* { dg-do run } */
/* { dg-options "-g" } */
/* { dg-skip-if "" { *-*-* }  { "*" } { "-O0" } } */

volatile int v++;

rettype
foo (..., sometype arg1, sometype arg2, ...)
{
  // whatever needed to grow the stack frame enough
  v++;
  /* { dg-final { gdb-test <line_of_v++> "arg1" "3" } } */
  /* { dg-final { gdb-test <line_of_v++> "arg2" "4" } } */
}

int
main ()
{
  foo (..., 3, 4, ...);
  return 0;
}

might be enough.

        Jakub

Reply via email to