This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/80706] [7/8 Regression] peephole2 uses uninitialized stack variables on i686


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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Simplified testcase:
/* PR target/80706 */
/* { dg-do run { target sse2_runtime } } */
/* { dg-options "-O2 -msse2" } */

union U { double value; struct S { int lsw; int msw; } parts; };

__attribute__((noinline, noclone)) double
foo (void)
{
  __asm volatile ("" : : : "memory");
  return 2.0;
}

__attribute__((noinline, noclone)) double
bar (void)
{
  double s = foo ();
  union U z;
  z.value = s;
  z.parts.lsw = 0;
  return z.value * z.value + s * s;
}

int
main ()
{
  if (bar () != 8.0)
    __builtin_abort ();
  return 0;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]