OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gcc.target/] [s390/] [pr24624.c] - Diff between revs 324 and 384

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 324 Rev 384
/* This used to ICE due to a backend problem on s390.  */
/* This used to ICE due to a backend problem on s390.  */
 
 
/* { dg-do compile } */
/* { dg-do compile } */
/* { dg-options "-O1 -mpacked-stack" } */
/* { dg-options "-O1 -mpacked-stack" } */
 
 
typedef unsigned int __u32;
typedef unsigned int __u32;
typedef struct
typedef struct
{
{
  volatile int counter;
  volatile int counter;
} __attribute__ ((aligned (4))) atomic_t;
} __attribute__ ((aligned (4))) atomic_t;
static __inline__ __attribute__ ((always_inline))
static __inline__ __attribute__ ((always_inline))
     void atomic_inc (volatile atomic_t * v)
     void atomic_inc (volatile atomic_t * v)
{
{
  (
  (
    {
    {
    typeof (v->counter) old_val, new_val;
    typeof (v->counter) old_val, new_val;
  __asm__ __volatile__ (
  __asm__ __volatile__ (
        "   l     %0,0(%3)\n"
        "   l     %0,0(%3)\n"
        "0: lr    %1,%0\n"
        "0: lr    %1,%0\n"
        "   ar    %1,%4\n"
        "   ar    %1,%4\n"
        "   cs    %0,%1,0(%3)\n"
        "   cs    %0,%1,0(%3)\n"
        "   jl    0b":
        "   jl    0b":
        "=&d" (old_val), "=&d" (new_val), "=m" (((atomic_t *) (v))->counter):
        "=&d" (old_val), "=&d" (new_val), "=m" (((atomic_t *) (v))->counter):
        "a" (v), "d" (1), "m" (((atomic_t *) (v))->counter):
        "a" (v), "d" (1), "m" (((atomic_t *) (v))->counter):
        "cc", "memory");
        "cc", "memory");
    });
    });
}
}
extern unsigned long volatile __attribute__ ((section (".data"))) jiffies;
extern unsigned long volatile __attribute__ ((section (".data"))) jiffies;
struct inet_peer
struct inet_peer
{
{
  unsigned long dtime;
  unsigned long dtime;
  atomic_t refcnt;
  atomic_t refcnt;
};
};
static volatile int peer_total;
static volatile int peer_total;
int inet_peer_threshold = 65536 + 128;
int inet_peer_threshold = 65536 + 128;
int inet_peer_minttl = 120 * 100;
int inet_peer_minttl = 120 * 100;
int inet_peer_maxttl = 10 * 60 * 100;
int inet_peer_maxttl = 10 * 60 * 100;
static int
static int
cleanup_once (unsigned long ttl)
cleanup_once (unsigned long ttl)
{
{
  struct inet_peer *p;
  struct inet_peer *p;
  if (p != ((void *) 0))
  if (p != ((void *) 0))
    {
    {
      if (((
      if (((
             {
             {
             1;}
             1;}
           ) && ((long) (jiffies) - (long) (p->dtime + ttl) < 0)))
           ) && ((long) (jiffies) - (long) (p->dtime + ttl) < 0)))
        {
        {
          return -1;
          return -1;
        }
        }
      atomic_inc (&p->refcnt);
      atomic_inc (&p->refcnt);
    }
    }
}
}
struct inet_peer *
struct inet_peer *
inet_getpeer (__u32 daddr, int create)
inet_getpeer (__u32 daddr, int create)
{
{
  int i;
  int i;
  int ttl;
  int ttl;
  if (peer_total >= inet_peer_threshold)
  if (peer_total >= inet_peer_threshold)
    ttl = inet_peer_minttl;
    ttl = inet_peer_minttl;
  else
  else
    ttl =
    ttl =
      inet_peer_maxttl - (inet_peer_maxttl -
      inet_peer_maxttl - (inet_peer_maxttl -
                          inet_peer_minttl) / 100 * peer_total /
                          inet_peer_minttl) / 100 * peer_total /
      inet_peer_threshold * 100;
      inet_peer_threshold * 100;
  for (i = 0; i < 30 && !cleanup_once (ttl); i++);
  for (i = 0; i < 30 && !cleanup_once (ttl); i++);
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.