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



Jakub Jelinek <jakub at gcc dot gnu.org> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

             Status|UNCONFIRMED                 |NEW

   Last reconfirmed|                            |2013-04-22

                 CC|                            |jakub at gcc dot gnu.org

   Target Milestone|---                         |4.8.1

            Summary|Miscompilation of bison     |[4.8/4.9 Regression]

                   |2.7.1 under "-Os            |Miscompilation of bison

                   |-fomit-frame-pointer"       |2.7.1 under "-Os

                   |                            |-fomit-frame-pointer"

     Ever Confirmed|0                           |1



--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-22 
07:07:00 UTC ---

Somewhat reduced testcase:

/* { dg-do run } */

/* { dg-options "-Os -fomit-frame-pointer -fno-asynchronous-unwind-tables" } */

/* { dg-additional-options "-march=i686" { target ia32 } } */



struct A { char a[16]; } a;

int f;



void __attribute__((noinline, noclone))

foo (int x, struct A y)

{

  (void) x;

  (void) y.a[0];

  asm volatile ("" : : : "memory");

}



static void

bar (struct A b)

{

  foo (0, b);

  if (f)

    f = 0;

}



void __attribute__((noinline, noclone))

baz (struct A b)

{

  bar (a);

  a = b;

}



void

bar1 (struct A b)

{

  bar (b);

}



void

bar2 (struct A b)

{

  bar (b);

}



int

main ()

{

  struct A b = { "\0\1\2\3\4\5\6\7\10\11\12\13\14\15\16\17" };

  baz (b);

  if (__builtin_memcmp (a.a, b.a, 12))

    __builtin_abort ();

  return 0;

}

Reply via email to