re PR bootstrap/57154 (Bootstrap broken for powerpc64-unknown-linux-gnu)

2013-05-03  Teresa Johnson  <tejohnson@google.com>

	PR bootstrap/57154
	* gcc.dg/pr57154.c: New test.

From-SVN: r198626
This commit is contained in:
Teresa Johnson 2013-05-06 12:46:53 +00:00 committed by Teresa Johnson
parent 0107dca2ad
commit 6a92731392
2 changed files with 48 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2013-05-03 Teresa Johnson <tejohnson@google.com>
PR bootstrap/57154
* gcc.dg/pr57154.c: New test.
2013-05-06 Richard Biener <rguenther@suse.de>
PR middle-end/57147

View File

@ -0,0 +1,43 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fschedule-insns" } */
#define PF_FROZEN 0x00010000
#define likely(x) __builtin_expect(!!(x), 1)
struct cur
{
unsigned long flags;
};
struct cur *cur;
unsigned long freeze_cnt;
extern int foo(void *);
extern int slow_path(void *);
static inline int freezing(void *p)
{
if (likely(!foo(&freeze_cnt)))
return 0;
return slow_path(p);
}
extern int blah(void);
int testcase(int check_kthr_stop)
{
int was_frozen = 0;
for (;;) {
if (!freezing(cur) ||
(check_kthr_stop && blah()))
cur->flags &= ~PF_FROZEN;
if (!(cur->flags & PF_FROZEN))
break;
was_frozen = 1;
}
return was_frozen;
}