On Tue, Jan 08, 2013 at 05:49:28PM +0100, Jan Hubicka wrote:
> --- testsuite/gcc.c-torture/execute/pr55875.c (revision 0)
> +++ testsuite/gcc.c-torture/execute/pr55875.c (revision 0)
> @@ -0,0 +1,17 @@

Please add
/* PR tree-optimization/55875 */
here.

> +int a[250];
> +__attribute__ ((noinline))
> +t(int i)
> +{
> +  if (i==0)
> +    exit(0);
> +  if (i>255)
> +    abort ();
> +}
> +main()
> +{
> +  unsigned int i;
> +  for (i=0;;i++)
> +    {
> +      a[i]=t((unsigned char)(i+5));
> +    }
> +}
> Index: testsuite/g++.dg/torture/pr55875.C
> ===================================================================
> --- testsuite/g++.dg/torture/pr55875.C        (revision 0)
> +++ testsuite/g++.dg/torture/pr55875.C        (revision 0)

And

// PR tree-optimization/55875
// { dg-do run }

here, dg-do compile is the default.

> @@ -0,0 +1,53 @@
> +struct A
> +{
> +  short int a1;
> +  unsigned char a2;
> +  unsigned int a3;
> +};
> +
> +struct B
> +{
> +  unsigned short b1;
> +  const A *b2;
> +};
> +
> +B b;
> +
> +__attribute__((noinline, noclone))
> +int foo (unsigned x)
> +{
> +  __asm volatile ("" : "+r" (x) : : "memory");
> +  return x;
> +}
> +
> +inline void
> +bar (const int &)
> +{
> +}
> +
> +__attribute__((noinline)) void
> +baz ()
> +{
> +  const A *a = b.b2;
> +  unsigned int i;
> +  unsigned short n = b.b1;
> +  for (i = 0; i < n; ++i)
> +    if (a[i].a1 == 11)
> +      {
> +    if (i > 0 && (a[i - 1].a2 & 1))
> +      continue;
> +    bar (foo (2));
> +    return;

There should be tabs on the 4 above lines, just bugzilla ate it.

        Jakub

Reply via email to