Commit a283136a by H.J. Lu Committed by H.J. Lu

Add a testcase for PR rtl-optimization/60700

	PR rtl-optimization/60700
	* gcc.target/i386/pr60700.c: New test.

From-SVN: r208962
parent 80dc1f0c
2014-03-31 H.J. Lu <hongjiu.lu@intel.com>
PR rtl-optimization/60700
* gcc.target/i386/pr60700.c: New test.
2014-03-31 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
PR target/60650
......
/* PR rtl-optimization/60700 */
/* { dg-do run { target ia32 } } */
/* { dg-options "-O3 -march=i686" } */
int
__attribute__((noinline))
foo (void)
{
return 0;
}
void *g = (void *)1;
struct st {
char data[36]; /* must be greater than 32. */
};
int
__attribute__((noinline))
repro(struct st **out)
{
int status = 0;
*out = 0;
status = foo();
if (status != 0) {
return status;
}
if (0 == g) {
status = 999;
return status;
}
*out = (struct st *)__builtin_malloc(sizeof(struct st));
if (0 == *out) {
status = 42;
return status;
}
__builtin_memset(*out, 0, sizeof(struct st));
return status;
}
int
main ()
{
struct st *p;
int ret = repro (&p);
unsigned int i;
for (i = 0; i < sizeof (p->data)/sizeof (p->data[0]); i++)
if (p->data[i] != 0)
__builtin_abort ();
return ret;
}
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