1 /* { dg-additional-options "-O3 -Wno-analyzer-too-complex" } */
2 /* TODO: reduce this; was triggering this assert:
3 gcc_assert (pruned_state != existing_state);
6 typedef unsigned char Byte
;
7 typedef unsigned int uInt
;
11 typedef voidp (*alloc_func
)(voidp opaque
, uInt items
, uInt size
);
13 typedef struct z_stream_s
{
18 typedef z_stream
*z_streamp
;
20 typedef struct inflate_huft_s inflate_huft
;
22 struct inflate_huft_s
{
30 static int huft_build(uInt
*, uInt
, uInt
, const uInt
*, const uInt
*,
31 inflate_huft
**, uInt
*, inflate_huft
*, uInt
*, uInt
*);
33 static int huft_build(uInt
*b
, uInt n
, uInt s
, const uInt
*d
, const uInt
*e
,
34 inflate_huft
**t
, uInt
*m
, inflate_huft
*hp
, uInt
*hn
,
49 struct inflate_huft_s r
; /* { dg-message "region created on stack here" } */
81 *t
= (inflate_huft
*)0;
87 for (j
= 1; j
<= 15; j
++)
101 for (y
= 1 << j
; j
< i
; j
++, y
<<= 1)
127 u
[0] = (inflate_huft
*)0;
128 q
= (inflate_huft
*)0;
131 for (; k
<= g
; k
++) {
140 z
= z
> (uInt
)l
? l
: z
;
141 if ((f
= 1 << (j
= k
- w
)) > a
+ 1) {
146 if ((f
<<= 1) <= *++xp
)
160 r
.what
.Bits
= (Byte
)l
;
161 r
.what
.Exop
= (Byte
)j
;
163 r
.base
= (uInt
)(q
- u
[h
- 1] - j
);
169 r
.what
.Bits
= (Byte
)(k
- w
);
171 r
.what
.Exop
= 128 + 64;
173 r
.what
.Exop
= (Byte
)(*p
< 256 ? 0 : 32 + 64);
176 r
.what
.Exop
= (Byte
)(e
[*p
- s
] + 16 + 64);
177 r
.base
= d
[*p
++ - s
];
181 for (j
= i
>> w
; j
< z
; j
+= f
)
182 q
[j
] = r
; /* { dg-warning "use of uninitialized value 'r.base'" } */
185 /* The analyzer thinks that h can be -1 here.
186 This is probably a false positive. */
187 while ((i
& mask
) != x
[h
]) { /* { dg-bogus "under-read" "" { xfail *-*-* } } */
195 return y
!= 0 && g
!= 1 ? (-5) : 0;
198 extern const uInt cplens
[31];
199 extern const uInt cplext
[31];
200 extern const uInt cpdist
[30];
201 extern const uInt cpdext
[30];
203 int inflate_trees_dynamic(uInt nl
, uInt nd
, uInt
*c
, uInt
*bl
, uInt
*bd
,
204 inflate_huft
**tl
, inflate_huft
**td
,
205 inflate_huft
*hp
, z_streamp z
) {
210 if ((v
= (uInt
*)(*((z
)->zalloc
))((z
)->opaque
, (288), (sizeof(uInt
)))) == 0)
213 r
= huft_build(c
, nl
, 257, cplens
, cplext
, tl
, bl
, hp
, &hn
, v
);
214 r
= huft_build(c
+ nl
, nd
, 0, cpdist
, cpdext
, td
, bd
, hp
, &hn
, v
);