annotate gcc/testsuite/gcc.dg/torture/pr58079.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-options "-mlong-calls" { target mips*-*-* } } */
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 typedef unsigned char u8;
kono
parents:
diff changeset
4 typedef unsigned short u16;
kono
parents:
diff changeset
5 typedef unsigned int __kernel_size_t;
kono
parents:
diff changeset
6 typedef __kernel_size_t size_t;
kono
parents:
diff changeset
7 struct list_head {
kono
parents:
diff changeset
8 struct list_head *next;
kono
parents:
diff changeset
9 };
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 struct dmx_ts_feed {
kono
parents:
diff changeset
12 int is_filtering;
kono
parents:
diff changeset
13 };
kono
parents:
diff changeset
14 struct dmx_section_feed {
kono
parents:
diff changeset
15 u16 secbufp;
kono
parents:
diff changeset
16 u16 seclen;
kono
parents:
diff changeset
17 u16 tsfeedp;
kono
parents:
diff changeset
18 };
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 typedef int (*dmx_ts_cb) (
kono
parents:
diff changeset
21 const u8 * buffer1,
kono
parents:
diff changeset
22 size_t buffer1_length,
kono
parents:
diff changeset
23 const u8 * buffer2,
kono
parents:
diff changeset
24 size_t buffer2_length
kono
parents:
diff changeset
25 );
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 struct dvb_demux_feed {
kono
parents:
diff changeset
28 union {
kono
parents:
diff changeset
29 struct dmx_ts_feed ts;
kono
parents:
diff changeset
30 struct dmx_section_feed sec;
kono
parents:
diff changeset
31 } feed;
kono
parents:
diff changeset
32 union {
kono
parents:
diff changeset
33 dmx_ts_cb ts;
kono
parents:
diff changeset
34 } cb;
kono
parents:
diff changeset
35 int type;
kono
parents:
diff changeset
36 u16 pid;
kono
parents:
diff changeset
37 int ts_type;
kono
parents:
diff changeset
38 struct list_head list_head;
kono
parents:
diff changeset
39 };
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 struct dvb_demux {
kono
parents:
diff changeset
42 int (*stop_feed)(struct dvb_demux_feed *feed);
kono
parents:
diff changeset
43 struct list_head feed_list;
kono
parents:
diff changeset
44 };
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 int dvb_dmx_swfilter_section_packet (struct dvb_demux_feed *, const u8 *);
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 static
kono
parents:
diff changeset
49 inline
kono
parents:
diff changeset
50 __attribute__((always_inline))
kono
parents:
diff changeset
51 u8
kono
parents:
diff changeset
52 payload(const u8 *tsp)
kono
parents:
diff changeset
53 {
kono
parents:
diff changeset
54 if (tsp[3] & 0x20) {
kono
parents:
diff changeset
55 return 184 - 1 - tsp[4];
kono
parents:
diff changeset
56 }
kono
parents:
diff changeset
57 return 184;
kono
parents:
diff changeset
58 }
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60 static
kono
parents:
diff changeset
61 inline
kono
parents:
diff changeset
62 __attribute__((always_inline))
kono
parents:
diff changeset
63 int
kono
parents:
diff changeset
64 dvb_dmx_swfilter_payload(struct dvb_demux_feed *feed, const u8 *buf)
kono
parents:
diff changeset
65 {
kono
parents:
diff changeset
66 int count = payload(buf);
kono
parents:
diff changeset
67 int p;
kono
parents:
diff changeset
68 if (count == 0)
kono
parents:
diff changeset
69 return -1;
kono
parents:
diff changeset
70 return feed->cb.ts(&buf[p], count, ((void *)0), 0);
kono
parents:
diff changeset
71 }
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 static
kono
parents:
diff changeset
74 inline
kono
parents:
diff changeset
75 __attribute__((always_inline))
kono
parents:
diff changeset
76 void
kono
parents:
diff changeset
77 dvb_dmx_swfilter_packet_type(struct dvb_demux_feed *feed, const u8 *buf)
kono
parents:
diff changeset
78 {
kono
parents:
diff changeset
79 switch (feed->type) {
kono
parents:
diff changeset
80 case 0:
kono
parents:
diff changeset
81 if (feed->ts_type & 1) {
kono
parents:
diff changeset
82 dvb_dmx_swfilter_payload(feed, buf);
kono
parents:
diff changeset
83 }
kono
parents:
diff changeset
84 if (dvb_dmx_swfilter_section_packet(feed, buf) < 0)
kono
parents:
diff changeset
85 feed->feed.sec.seclen = feed->feed.sec.secbufp = 0;
kono
parents:
diff changeset
86 }
kono
parents:
diff changeset
87 }
kono
parents:
diff changeset
88
kono
parents:
diff changeset
89 static
kono
parents:
diff changeset
90 void
kono
parents:
diff changeset
91 dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf)
kono
parents:
diff changeset
92 {
kono
parents:
diff changeset
93 struct dvb_demux_feed *feed;
kono
parents:
diff changeset
94 int dvr_done = 0;
kono
parents:
diff changeset
95
kono
parents:
diff changeset
96 for (feed = ({ const typeof( ((typeof(*feed) *)0)->list_head ) *__mptr = ((&demux->feed_list)->next); (typeof(*feed) *)( (char *)__mptr - __builtin_offsetof(typeof(*feed),list_head) );}); __builtin_prefetch(feed->list_head.next), &feed->list_head != (&demux->feed_list); feed = ({ const typeof( ((typeof(*feed) *)0)->list_head ) *__mptr = (feed->list_head.next); (typeof(*feed) *)( (char *)__mptr - __builtin_offsetof(typeof(*feed),list_head) );})) {
kono
parents:
diff changeset
97 if (((((feed)->type == 0) && ((feed)->feed.ts.is_filtering) && (((feed)->ts_type & (1 | 8)) == 1))) && (dvr_done++))
kono
parents:
diff changeset
98 dvb_dmx_swfilter_packet_type(feed, buf);
kono
parents:
diff changeset
99 else if (feed->pid == 0x2000)
kono
parents:
diff changeset
100 feed->cb.ts(buf, 188, ((void *)0), 0);
kono
parents:
diff changeset
101 }
kono
parents:
diff changeset
102 }
kono
parents:
diff changeset
103 void dvb_dmx_swfilter_packets(struct dvb_demux *demux, const u8 *buf, size_t count)
kono
parents:
diff changeset
104 {
kono
parents:
diff changeset
105 while (count--) {
kono
parents:
diff changeset
106 dvb_dmx_swfilter_packet(demux, buf);
kono
parents:
diff changeset
107 }
kono
parents:
diff changeset
108 }