Commit 69c328ec by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/78558 (Incorrect loop optimization leads to crash)

	PR tree-optimization/78558
	* gcc.dg/vect/pr78558.c: New test.

From-SVN: r253661
parent 1d5b9dd5
2017-10-11 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/78558
* gcc.dg/vect/pr78558.c: New test.
PR c++/82414
* g++.dg/lto/pr82414_0.C: New test.
......
/* PR tree-optimization/78558 */
#include "tree-vect.h"
struct S
{
char p[48];
unsigned long long q, r, s;
} s[50];
struct D
{
unsigned long long q, r;
} d[50];
void
foo (void)
{
unsigned long i;
for (i = 0; i < 50; ++i)
{
d[i].q = s[i].q;
d[i].r = s[i].r;
}
}
int
main ()
{
check_vect ();
unsigned long i;
for (i = 0; i < 50; ++i)
{
s[i].q = i;
s[i].r = 50 * i;
}
asm volatile ("" : : "g" (s), "g" (d) : "memory");
foo ();
asm volatile ("" : : "g" (s), "g" (d) : "memory");
for (i = 0; i < 50; ++i)
if (d[i].q != i || d[i].r != 50 * i)
abort ();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment