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

--- Comment #17 from Peter Bergner <bergner at gcc dot gnu.org> ---
Here's a compile time only test case that correctly FAILs using the unpatched
compiler and passes using the patched compiler (requires a small change to
target-supports.exp to add the rop_ok test):

/* { dg-require-effective-target rop_ok } */
/* { dg-options "-O1 -mrop-protect -mdejagnu-cpu=power10" } */

extern void foo (void);

long int
__attribute__ ((__optimize__ ("no-inline")))
func (long int cond)
{
  if (cond)
    foo ();
  return cond;
}

/* Ensure hashst comes after mflr and hashchk comes after ld 0,16(1).  */
/* { dg-final { scan-assembler "mflr 0.*hashst 0," } } */
/* { dg-final { scan-assembler "ld 0,16\\\(1\\\).*hashchk 0," } } */

Reply via email to