-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path2289.p4
377 lines (360 loc) · 12.3 KB
/
2289.p4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
/*Invoking preprocessor
cpp -C -undef -nostdinc -x assembler-with-cpp -Ip4_tv/p4c/build/p4include -D__TARGET_BMV2__ -Ip4_tv/p4c/build/p4include -Ip4_tv/p4c/build/p4include ./2289.p4i
ParseAnnotationBodies_0_ParseAnnotations
ParseAnnotationBodies_1_ClearTypeMap
FrontEnd_0_ParseAnnotationBodies
FrontEnd_1_PrettyPrint
FrontEnd_2_ValidateParsedProgram
FrontEnd_3_CreateBuiltins
FrontEnd_4_ResolveReferences
ConstantFolding_0_DoConstantFolding
FrontEnd_5_ConstantFolding
InstantiateDirectCalls_0_ResolveReferences
InstantiateDirectCalls_1_DoInstantiateCalls
FrontEnd_6_InstantiateDirectCalls
FrontEnd_7_ResolveReferences
Deprecated_0_ResolveReferences
Deprecated_1_CheckDeprecated
FrontEnd_8_Deprecated
FrontEnd_9_CheckNamedArgs
FrontEnd_10_TypeInference
FrontEnd_11_ValidateMatchAnnotations
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
DefaultArguments_0_TypeChecking
DefaultArguments_1_DoDefaultArguments
FrontEnd_12_DefaultArguments
BindTypeVariables_0_ClearTypeMap
BindTypeVariables_1_ResolveReferences
BindTypeVariables_2_TypeInference
BindTypeVariables_3_DoBindTypeVariables
FrontEnd_13_BindTypeVariables
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
StructInitializers_0_TypeChecking
StructInitializers_1_CreateStructInitializers
StructInitializers_2_ClearTypeMap
FrontEnd_14_StructInitializers
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
TableKeyNames_0_TypeChecking
TableKeyNames_1_DoTableKeyNames
FrontEnd_15_TableKeyNames
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
ConstantFolding_0_TypeChecking
ConstantFolding_1_DoConstantFolding
ConstantFolding_2_ClearTypeMap
FrontEnd_16_ConstantFolding
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
P4::TypeChecking_2_ApplyTypesToExpressions
P4::TypeChecking_3_ResolveReferences
P4::StrengthReduction_0_TypeChecking
P4::StrengthReduction_1_StrengthReduction
FrontEnd_17_StrengthReduction
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
UselessCasts_0_TypeChecking
UselessCasts_1_RemoveUselessCasts
FrontEnd_18_UselessCasts
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SimplifyControlFlow_0_TypeChecking
SimplifyControlFlow_1_DoSimplifyControlFlow
FrontEnd_19_SimplifyControlFlow
FrontEnd_20_FrontEndDump
PassRepeated_0_ResolveReferences
PassRepeated_1_RemoveUnusedDeclarations
PassRepeated_2_ResolveReferences
PassRepeated_3_RemoveUnusedDeclarations
PassRepeated_4_ResolveReferences
PassRepeated_5_RemoveUnusedDeclarations
RemoveAllUnusedDeclarations_0_PassRepeated
FrontEnd_21_RemoveAllUnusedDeclarations
SimplifyParsers_0_ResolveReferences
SimplifyParsers_1_DoSimplifyParsers
FrontEnd_22_SimplifyParsers
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
ResetHeaders_0_TypeChecking
ResetHeaders_1_DoResetHeaders
FrontEnd_23_ResetHeaders
UniqueNames_0_ResolveReferences
UniqueNames_1_FindSymbols
UniqueNames_2_RenameSymbols
FrontEnd_24_UniqueNames
FrontEnd_25_MoveDeclarations
FrontEnd_26_MoveInitializers
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SideEffectOrdering_0_TypeChecking
SideEffectOrdering_1_DoSimplifyExpressions
FrontEnd_27_SideEffectOrdering
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SetHeaders_0_TypeChecking
SetHeaders_1_DoSetHeaders
FrontEnd_28_SetHeaders
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SimplifyControlFlow_0_TypeChecking
SimplifyControlFlow_1_DoSimplifyControlFlow
P4::TypeChecking_2_ResolveReferences
P4::TypeChecking_3_TypeInference
SimplifyControlFlow_2_TypeChecking
SimplifyControlFlow_3_DoSimplifyControlFlow
FrontEnd_29_SimplifyControlFlow
FrontEnd_30_MoveDeclarations
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SimplifyDefUse_0_TypeChecking
bugs/crash/fixed/2289.p4(44): [--Wwarn=uninitialized_out_param] warning: out parameter byaA may be uninitialized when simple_action terminates
action simple_action(out bit<16> byaA) {
^^^^
bugs/crash/fixed/2289.p4(44)
action simple_action(out bit<16> byaA) {
^^^^^^^^^^^^^
SimplifyDefUse_1_DoSimplifyDefUse
FrontEnd_31_SimplifyDefUse
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
UniqueParameters_0_TypeChecking
UniqueParameters_1_(anonymous namespace)::FindActionCalls
UniqueParameters_2_FindParameters
UniqueParameters_3_RenameSymbols
UniqueParameters_4_ClearTypeMap
FrontEnd_32_UniqueParameters
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SimplifyControlFlow_0_TypeChecking
SimplifyControlFlow_1_DoSimplifyControlFlow
P4::TypeChecking_2_ResolveReferences
P4::TypeChecking_3_TypeInference
SimplifyControlFlow_2_TypeChecking
SimplifyControlFlow_3_DoSimplifyControlFlow
FrontEnd_33_SimplifyControlFlow
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
ConstantFolding_0_TypeChecking
ConstantFolding_1_DoConstantFolding
ConstantFolding_2_ClearTypeMap
SpecializeAll_0_ConstantFolding
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SpecializeAll_1_TypeChecking
SpecializeAll_2_FindSpecializations
SpecializeAll_3_Specialize
PassRepeated_0_ResolveReferences
PassRepeated_1_RemoveUnusedDeclarations
RemoveAllUnusedDeclarations_0_PassRepeated
SpecializeAll_4_RemoveAllUnusedDeclarations
FrontEnd_34_SpecializeAll
RemoveParserControlFlow_0_DoRemoveParserControlFlow
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SimplifyControlFlow_0_TypeChecking
SimplifyControlFlow_1_DoSimplifyControlFlow
RemoveParserControlFlow_1_SimplifyControlFlow
FrontEnd_35_RemoveParserControlFlow
RemoveReturns_0_ResolveReferences
RemoveReturns_1_DoRemoveReturns
FrontEnd_36_RemoveReturns
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
RemoveDontcareArgs_0_TypeChecking
RemoveDontcareArgs_1_DontcareArgs
RemoveDontcareArgs_2_ClearTypeMap
FrontEnd_37_RemoveDontcareArgs
MoveConstructors_0_ResolveReferences
MoveConstructors_1_MoveConstructorsImpl
FrontEnd_38_MoveConstructors
PassRepeated_0_ResolveReferences
PassRepeated_1_RemoveUnusedDeclarations
RemoveAllUnusedDeclarations_0_PassRepeated
FrontEnd_39_RemoveAllUnusedDeclarations
FrontEnd_40_ClearTypeMap
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
P4::TypeChecking_1_TypeInference
EvaluatorPass_0_TypeChecking
EvaluatorPass_0_TypeChecking
EvaluatorPass_1_Evaluator
EvaluatorPass_1_Evaluator
FrontEnd_41_EvaluatorPass
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
P4::InlinePass_0_TypeChecking
P4::InlinePass_1_DiscoverInlining
P4::InlinePass_2_InlineDriver
PassRepeated_0_ResolveReferences
PassRepeated_1_RemoveUnusedDeclarations
RemoveAllUnusedDeclarations_0_PassRepeated
P4::InlinePass_3_RemoveAllUnusedDeclarations
P4::Inline_0_InlinePass
P4::TypeChecking_2_ResolveReferences
P4::TypeChecking_2_ResolveReferences
P4::TypeChecking_3_TypeInference
P4::TypeChecking_3_TypeInference
EvaluatorPass_2_TypeChecking
EvaluatorPass_2_TypeChecking
EvaluatorPass_3_Evaluator
EvaluatorPass_3_Evaluator
P4::Inline_1_EvaluatorPass
FrontEnd_42_Inline
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
InlineActions_0_TypeChecking
InlineActions_1_DiscoverActionsInlining
InlineActions_2_InlineDriver
PassRepeated_0_ResolveReferences
PassRepeated_1_RemoveUnusedDeclarations
RemoveAllUnusedDeclarations_0_PassRepeated
InlineActions_3_RemoveAllUnusedDeclarations
FrontEnd_43_InlineActions
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
InlineFunctions_0_TypeChecking
InlineFunctions_1_DiscoverFunctionsInlining
InlineFunctions_2_InlineDriver
PassRepeated_0_ResolveReferences
PassRepeated_1_RemoveUnusedDeclarations
PassRepeated_2_ResolveReferences
PassRepeated_3_RemoveUnusedDeclarations
RemoveAllUnusedDeclarations_0_PassRepeated
InlineFunctions_3_RemoveAllUnusedDeclarations
FrontEnd_44_InlineFunctions
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
CheckConstants_0_TypeChecking
CheckConstants_1_DoCheckConstants
FrontEnd_45_CheckConstants
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SimplifyControlFlow_0_TypeChecking
SimplifyControlFlow_1_DoSimplifyControlFlow
P4::TypeChecking_2_ResolveReferences
P4::TypeChecking_3_TypeInference
SimplifyControlFlow_2_TypeChecking
SimplifyControlFlow_3_DoSimplifyControlFlow
FrontEnd_46_SimplifyControlFlow
RemoveParserControlFlow_0_DoRemoveParserControlFlow
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SimplifyControlFlow_0_TypeChecking
SimplifyControlFlow_1_DoSimplifyControlFlow
RemoveParserControlFlow_1_SimplifyControlFlow
FrontEnd_47_RemoveParserControlFlow
UniqueNames_0_ResolveReferences
UniqueNames_1_FindSymbols
UniqueNames_2_RenameSymbols
FrontEnd_48_UniqueNames
LocalizeAllActions_0_TagGlobalActions
PassRepeated_0_ResolveReferences
PassRepeated_1_FindGlobalActionUses
PassRepeated_2_LocalizeActions
LocalizeAllActions_1_PassRepeated
LocalizeAllActions_2_ResolveReferences
LocalizeAllActions_3_FindRepeatedActionUses
LocalizeAllActions_4_DuplicateActions
PassRepeated_0_ResolveReferences
PassRepeated_1_RemoveUnusedDeclarations
PassRepeated_2_ResolveReferences
PassRepeated_3_RemoveUnusedDeclarations
RemoveAllUnusedDeclarations_0_PassRepeated
LocalizeAllActions_5_RemoveAllUnusedDeclarations
FrontEnd_49_LocalizeAllActions
UniqueNames_0_ResolveReferences
UniqueNames_1_FindSymbols
UniqueNames_2_RenameSymbols
FrontEnd_50_UniqueNames
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
UniqueParameters_0_TypeChecking
UniqueParameters_1_(anonymous namespace)::FindActionCalls
UniqueParameters_2_FindParameters
UniqueParameters_3_RenameSymbols
UniqueParameters_4_ClearTypeMap
FrontEnd_51_UniqueParameters
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SimplifyControlFlow_0_TypeChecking
SimplifyControlFlow_1_DoSimplifyControlFlow
FrontEnd_52_SimplifyControlFlow
FrontEnd_53_HierarchicalNames
FrontEnd_54_FrontEndLast
BMV2::SimpleSwitchMidEnd_0_CheckTableSize
BMV2::SimpleSwitchMidEnd_1_RemoveMiss
BMV2::SimpleSwitchMidEnd_2_EliminateNewtype
BMV2::SimpleSwitchMidEnd_3_EliminateSerEnums
BMV2::SimpleSwitchMidEnd_4_RemoveActionParameters
BMV2::SimpleSwitchMidEnd_5_ConvertEnums
BMV2::SimpleSwitchMidEnd_6_VisitFunctor
BMV2::SimpleSwitchMidEnd_7_OrderArguments
BMV2::SimpleSwitchMidEnd_8_TypeChecking
BMV2::SimpleSwitchMidEnd_9_SimplifyKey
BMV2::SimpleSwitchMidEnd_10_ConstantFolding
BMV2::SimpleSwitchMidEnd_11_StrengthReduction
BMV2::SimpleSwitchMidEnd_12_SimplifySelectCases
BMV2::SimpleSwitchMidEnd_13_ExpandLookahead
BMV2::SimpleSwitchMidEnd_14_ExpandEmit
BMV2::SimpleSwitchMidEnd_15_SimplifyParsers
BMV2::SimpleSwitchMidEnd_16_StrengthReduction
BMV2::SimpleSwitchMidEnd_17_EliminateTuples
BMV2::SimpleSwitchMidEnd_18_SimplifyComparisons
BMV2::SimpleSwitchMidEnd_19_CopyStructures
In file: p4_tv/p4c/ir/ir-inline.h:152
[31mCompiler Bug[0m: visitor returned invalid type Vector<Declaration> for IndexedVector<StatOrDecl>
running cc -E -C -undef -nostdinc -x assembler-with-cpp -I p4_tv/p4c/build/p4include -o ./2289.p4i bugs/crash/fixed/2289.p4
running p4_tv/p4c/build/p4c-bm2-ss -I p4_tv/p4c/build/p4include --p4v=16 -vvv -o ./2289.json ./2289.p4i --arch v1model
*/
#include <core.p4>
#include <v1model.p4>
header ethernet_t {
bit<48> dst_addr;
bit<48> src_addr;
bit<16> eth_type;
}
header simple_struct {
bit<32> a;
}
struct nested_struct {
simple_struct s;
}
struct Headers {
ethernet_t eth_hdr;
}
struct Meta {
}
bit<16> function_1() {
nested_struct tmp_struct = {{1}};
tmp_struct.s.a = 1;
return (bit<16>)(1);
}
bit<16> function_2(in bit<16> val) {
return function_1();
}
parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t sm) {
state start {
transition parse_hdrs;
}
state parse_hdrs {
pkt.extract(hdr.eth_hdr);
transition accept;
}
}
control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) {
action simple_action(out bit<16> byaA) {
h.eth_hdr.eth_type = function_2(function_1());
}
apply {
function_1();
simple_action(h.eth_hdr.eth_type);
}
}
control vrfy(inout Headers h, inout Meta m) { apply {} }
control update(inout Headers h, inout Meta m) { apply {} }
control egress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply {} }
control deparser(packet_out b, in Headers h) { apply {b.emit(h);} }
V1Switch(p(), vrfy(), ingress(), egress(), update(), deparser()) main;