diff options
author | Andreas Krebbel <krebbel1@de.ibm.com> | 2005-11-09 11:45:01 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@gcc.gnu.org> | 2005-11-09 11:45:01 +0000 |
commit | fb3712f61f4ecb0fca8738013f68f75b901a33b4 (patch) | |
tree | 5c9c08a409a2a9a4f8f36f1eb4288998c6d45c18 /gcc/testsuite/gcc.dg | |
parent | 297a777d4748114bc58d17eb41d7b8026f20a711 (diff) | |
download | gcc-fb3712f61f4ecb0fca8738013f68f75b901a33b4.zip gcc-fb3712f61f4ecb0fca8738013f68f75b901a33b4.tar.gz gcc-fb3712f61f4ecb0fca8738013f68f75b901a33b4.tar.bz2 |
s390.c (struct s390_frame_layout): New fields first_save_gpr_slot and last_save_gpr_slot.
2005-11-09 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/s390.c (struct s390_frame_layout): New fields
first_save_gpr_slot and last_save_gpr_slot.
(cfun_grps_save_area_size, s390_frame_info, s390_emit_prologue,
s390_emit_epilogue, s390_initial_elimination_offset): Replaced
first_save_gpr and last_save_gpr with the _slot variants.
(s390_register_info): Calculate first_save_gpr_slot and
last_save_gpr_slot using regs_ever_live.
* testsuite/gcc.dg/pr24624.c: Testcase added.
From-SVN: r106688
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr24624.c | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr24624.c b/gcc/testsuite/gcc.dg/pr24624.c new file mode 100644 index 0000000..bc2070c --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr24624.c @@ -0,0 +1,67 @@ +/* This used to ICE due to a backend problem on s390. */ + +/* { dg-do compile } */ +/* { dg-options "-O1 -mpacked-stack" } */ + +typedef unsigned int __u32; +typedef struct +{ + volatile int counter; +} __attribute__ ((aligned (4))) atomic_t; +static __inline__ __attribute__ ((always_inline)) + void atomic_inc (volatile atomic_t * v) +{ + ( + { + typeof (v->counter) old_val, new_val; + __asm__ __volatile__ ( + " l %0,0(%3)\n" + "0: lr %1,%0\n" + " ar %1,%4\n" + " cs %0,%1,0(%3)\n" + " jl 0b": + "=&d" (old_val), "=&d" (new_val), "=m" (((atomic_t *) (v))->counter): + "a" (v), "d" (1), "m" (((atomic_t *) (v))->counter): + "cc", "memory"); + }); +} +extern unsigned long volatile __attribute__ ((section (".data"))) jiffies; +struct inet_peer +{ + unsigned long dtime; + atomic_t refcnt; +}; +static volatile int peer_total; +int inet_peer_threshold = 65536 + 128; +int inet_peer_minttl = 120 * 100; +int inet_peer_maxttl = 10 * 60 * 100; +static int +cleanup_once (unsigned long ttl) +{ + struct inet_peer *p; + if (p != ((void *) 0)) + { + if ((( + { + 1;} + ) && ((long) (jiffies) - (long) (p->dtime + ttl) < 0))) + { + return -1; + } + atomic_inc (&p->refcnt); + } +} +struct inet_peer * +inet_getpeer (__u32 daddr, int create) +{ + int i; + int ttl; + if (peer_total >= inet_peer_threshold) + ttl = inet_peer_minttl; + else + ttl = + inet_peer_maxttl - (inet_peer_maxttl - + inet_peer_minttl) / 100 * peer_total / + inet_peer_threshold * 100; + for (i = 0; i < 30 && !cleanup_once (ttl); i++); +} |