From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/gcc.target/s390/pr24624.c | 67 +++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 gcc/testsuite/gcc.target/s390/pr24624.c (limited to 'gcc/testsuite/gcc.target/s390/pr24624.c') diff --git a/gcc/testsuite/gcc.target/s390/pr24624.c b/gcc/testsuite/gcc.target/s390/pr24624.c new file mode 100644 index 000000000..bc2070c4b --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/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++); +} -- cgit v1.2.3