This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/80706] [7/8 Regression] peephole2 uses uninitialized stack variables on i686
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 11 May 2017 08:05:25 +0000
- Subject: [Bug target/80706] [7/8 Regression] peephole2 uses uninitialized stack variables on i686
- Auto-submitted: auto-generated
- References: <bug-80706-4@http.gcc.gnu.org/bugzilla/>
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;
}