OSDN Git Service

PR target/6428
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / 20020313-1.c
1 /* PR 5312 
2    The problem here is that the ia64 scheduler saw a sequence of L L M type
3    insns, and messed up its internal state on which slot it was issuing
4    to, and aborted.  */
5
6 /* { dg-do compile { target ia64-*-* } } */
7 /* { dg-options "-O2 -mconstant-gp" } */
8
9 typedef unsigned long __u64;
10 typedef unsigned int __u32;
11 typedef struct { } spinlock_t;
12 struct cpuinfo_ia64 {
13         union {
14                 struct {
15                         __u32 irq_count;
16                         __u32 bh_count;
17                 } f;
18                 __u64 irq_and_bh_counts;
19         } irq_stat;
20         __u32 softirq_pending;
21 } __attribute__ ((aligned ((1UL << 14)))) ;
22 enum
23 {
24         TCA_UNSPEC,
25         TCA_KIND,
26         TCA_OPTIONS,
27         TCA_STATS,
28         TCA_XSTATS,
29         TCA_RATE,
30 };
31 struct tc_stats
32 {
33         __u64 bytes;
34         __u32 packets;
35         __u32 drops;
36         __u32 overlimits;
37         __u32 bps;
38         __u32 pps;
39         __u32 qlen;
40         __u32 backlog;
41         spinlock_t *lock;
42 };
43 struct sk_buff {
44         unsigned int data_len;
45         unsigned char *tail;
46         unsigned char *end;
47 };
48 static inline int skb_is_nonlinear(const struct sk_buff *skb)
49 {
50         return skb->data_len;
51 }
52 static inline int skb_tailroom(const struct sk_buff *skb)
53 {
54         return skb_is_nonlinear(skb) ? 0 : skb->end-skb->tail;
55 }
56 struct rtattr
57 {
58         unsigned short rta_len;
59         unsigned short rta_type;
60 };
61 int qdisc_copy_stats(struct sk_buff *skb, struct tc_stats *st)
62 {
63         do { do { (((struct cpuinfo_ia64 *) (0xa000000000000000 + 2*(1UL << 14)))->irq_stat.f.bh_count)++; __asm__ __volatile__("": : :"memory"); } while (0); (void)(st->lock); } while (0);
64         ({ if (skb_tailroom(skb) < (int)( (((( ((sizeof(struct rtattr))+4 -1) & ~(4 -1) ) + ((char*)&st->lock - (char*)st)))+4 -1) & ~(4 -1) )) goto rtattr_failure; __rta_fill(skb, TCA_STATS, (char*)&st->lock - (char*)st, st); });
65         do { do { } while(0); do { do { __asm__ __volatile__("": : :"memory"); (((struct cpuinfo_ia64 *) (0xa000000000000000 + 2*(1UL << 14)))->irq_stat.f.bh_count)--; } while (0); if (__builtin_expect((((struct cpuinfo_ia64 *) (0xa000000000000000 + 2*(1UL << 14)))->softirq_pending), 0) && (((struct cpuinfo_ia64 *) (0xa000000000000000 + 2*(1UL << 14)))->irq_stat.f.bh_count) == 0) do_softirq(); } while (0); } while (0);
66         return 0;
67 rtattr_failure:
68         do { do { } while(0); do { do { __asm__ __volatile__("": : :"memory"); (((struct cpuinfo_ia64 *) (0xa000000000000000 + 2*(1UL << 14)))->irq_stat.f.bh_count)--; } while (0); if (__builtin_expect((((struct cpuinfo_ia64 *) (0xa000000000000000 + 2*(1UL << 14)))->softirq_pending), 0) && (((struct cpuinfo_ia64 *) (0xa000000000000000 + 2*(1UL << 14)))->irq_stat.f.bh_count) == 0) do_softirq(); } while (0); } while (0);
69         return -1;
70 }