URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 301 |
Rev 384 |
// { dg-do run }
|
// { dg-do run }
|
// { dg-options "-O2 -fstrict-aliasing" }
|
// { dg-options "-O2 -fstrict-aliasing" }
|
|
|
// Test that we don't let TBAA reorder an assignment across a
|
// Test that we don't let TBAA reorder an assignment across a
|
// placement new.
|
// placement new.
|
// See PR 29286.
|
// See PR 29286.
|
|
|
typedef __SIZE_TYPE__ size_t;
|
typedef __SIZE_TYPE__ size_t;
|
|
|
inline void* operator new(size_t, void* __p) throw() { return __p; }
|
inline void* operator new(size_t, void* __p) throw() { return __p; }
|
|
|
void __attribute__((noinline)) bar() {}
|
void __attribute__((noinline)) bar() {}
|
|
|
long __attribute__((noinline)) foo(double *p, int n)
|
long __attribute__((noinline)) foo(double *p, int n)
|
{
|
{
|
long *f;
|
long *f;
|
for (int i=0; i
|
for (int i=0; i
|
{
|
{
|
int *l = (int *)p;
|
int *l = (int *)p;
|
*l = 0;
|
*l = 0;
|
f = new (p) long;
|
f = new (p) long;
|
*f = -1;
|
*f = -1;
|
}
|
}
|
bar ();
|
bar ();
|
return *f;
|
return *f;
|
}
|
}
|
|
|
extern "C" void abort(void);
|
extern "C" void abort(void);
|
int main()
|
int main()
|
{
|
{
|
union {
|
union {
|
int i;
|
int i;
|
long l;
|
long l;
|
} u;
|
} u;
|
if (foo((double *)&u, 1) != -1)
|
if (foo((double *)&u, 1) != -1)
|
abort ();
|
abort ();
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.