From 1082d92293ba0e1b504d1788d9af1ff4f240f730 Mon Sep 17 00:00:00 2001 From: Mihai Budiu Date: Mon, 2 May 2022 15:46:45 -0700 Subject: [PATCH 1/6] Correctly handle don't care named arguments Signed-off-by: Mihai Budiu --- frontends/p4/simplifyDefUse.cpp | 2 +- .../issue3274-1-FrontEnd_41_SimplifyDefUse.p4 | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 testdata/p4_16_samples/issue3274-1-FrontEnd_41_SimplifyDefUse.p4 diff --git a/frontends/p4/simplifyDefUse.cpp b/frontends/p4/simplifyDefUse.cpp index d1ab020992..bfdc93e5a9 100644 --- a/frontends/p4/simplifyDefUse.cpp +++ b/frontends/p4/simplifyDefUse.cpp @@ -1490,7 +1490,7 @@ class RemoveUnused : public Transform { return mcs; } // removing - LOG3("Removing statement " << getOriginal()); + LOG3("Removing statement " << getOriginal() << IndentCtl::indent); return new IR::EmptyStatement(mcs->srcInfo); } return mcs; diff --git a/testdata/p4_16_samples/issue3274-1-FrontEnd_41_SimplifyDefUse.p4 b/testdata/p4_16_samples/issue3274-1-FrontEnd_41_SimplifyDefUse.p4 new file mode 100644 index 0000000000..b9e821fa62 --- /dev/null +++ b/testdata/p4_16_samples/issue3274-1-FrontEnd_41_SimplifyDefUse.p4 @@ -0,0 +1,12 @@ +void x() { +} +control c() { + apply { + x(); + } +} + +control _c(); +package top(_c _c); +top(c()) main; + From 811ed8a7437bab203ca68cfe0fcc693bd3380287 Mon Sep 17 00:00:00 2001 From: Mihai Budiu Date: Mon, 2 May 2022 19:07:43 -0700 Subject: [PATCH 2/6] WIP --- frontends/p4/frontend.cpp | 2 ++ frontends/p4/simplifyDefUse.cpp | 2 +- .../p4_16_samples_outputs/fabric_20190420/fabric.p4-stderr | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/frontends/p4/frontend.cpp b/frontends/p4/frontend.cpp index 381e2d526e..bcc8f81e46 100644 --- a/frontends/p4/frontend.cpp +++ b/frontends/p4/frontend.cpp @@ -243,6 +243,8 @@ const IR::P4Program *FrontEnd::run(const CompilerOptions &options, const IR::P4P new RemoveParserControlFlow(&refMap, &typeMap), // more ifs may have been added to parsers new UniqueNames(&refMap), // needed again after inlining new MoveDeclarations(), // needed again after inlining + new SimplifyDefUse(&refMap, &typeMap), + new RemoveUnusedDeclarations(&refMap), new SimplifyControlFlow(&refMap, &typeMap), new HierarchicalNames(), new FrontEndLast(), diff --git a/frontends/p4/simplifyDefUse.cpp b/frontends/p4/simplifyDefUse.cpp index bfdc93e5a9..0a6ab940ea 100644 --- a/frontends/p4/simplifyDefUse.cpp +++ b/frontends/p4/simplifyDefUse.cpp @@ -478,7 +478,7 @@ class FindUninitialized : public Inspector { const IR::ParameterList* parameters, Definitions* defs) { LOG2("Checking output parameters of " << block << - "; definitions are " << Log::endl << defs); + "; definitions are " << IndentCtl::endl << defs); for (auto p : parameters->parameters) { if (p->direction == IR::Direction::Out || p->direction == IR::Direction::InOut) { auto storage = definitions->storageMap->getStorage(p); diff --git a/testdata/p4_16_samples_outputs/fabric_20190420/fabric.p4-stderr b/testdata/p4_16_samples_outputs/fabric_20190420/fabric.p4-stderr index e69de29bb2..be3c644995 100644 --- a/testdata/p4_16_samples_outputs/fabric_20190420/fabric.p4-stderr +++ b/testdata/p4_16_samples_outputs/fabric_20190420/fabric.p4-stderr @@ -0,0 +1,3 @@ +fabric.p4(84): [--Wwarn=invalid_header] warning: accessing a field of a potentially invalid header hdr.gtpu_ipv4 + spgw_ingress.apply(hdr.gtpu_ipv4, hdr.gtpu_udp, hdr.gtpu, + ^^^^^^^^^^^^^ From 72701e54fa22dcdfd21ce08b07d9665218844a07 Mon Sep 17 00:00:00 2001 From: Mihai Budiu Date: Wed, 21 Sep 2022 14:31:01 -0700 Subject: [PATCH 3/6] Reference outputs changed Signed-off-by: Mihai Budiu --- .../action_inline1-frontend.p4 | 1 - .../action_inline2-frontend.p4 | 3 - .../action-bind-frontend.p4 | 1 - .../action_call_ubpf-frontend.p4 | 3 - .../after-return-frontend.p4 | 7 - .../control-as-param-frontend.p4 | 1 - .../control-as-param-midend.p4 | 11 +- .../p4_16_samples_outputs/decl2-frontend.p4 | 12 -- .../p4_16_samples_outputs/def-use-frontend.p4 | 3 - .../function-frontend.p4 | 1 - .../p4_16_samples_outputs/function.p4-stderr | 2 + .../gauntlet_action_return-bmv2-frontend.p4 | 5 - .../gauntlet_arithref_cast-bmv2-frontend.p4 | 3 - .../gauntlet_copy_out-bmv2-frontend.p4 | 2 - .../gauntlet_copy_out-bmv2-midend.p4 | 2 +- ...ntlet_exit_combination_18-bmv2-frontend.p4 | 1 - ...ntlet_exit_combination_20-bmv2-frontend.p4 | 3 - ...untlet_exit_combination_3-bmv2-frontend.p4 | 4 - ...untlet_exit_combination_8-bmv2-frontend.p4 | 3 - ...et_function_if_hdr_return-bmv2-frontend.p4 | 3 - .../gauntlet_function_return-bmv2-frontend.p4 | 6 - .../gauntlet_function_return-bmv2.p4-stderr | 1 + ...tlet_function_return_cast-bmv2-frontend.p4 | 3 - ...auntlet_hdr_function_cast-bmv2-frontend.p4 | 5 - .../gauntlet_hdr_function_cast-bmv2-midend.p4 | 1 - .../gauntlet_hdr_function_cast-bmv2.p4-stderr | 2 + .../gauntlet_hdr_out_in_action-bmv2.p4-stderr | 3 + .../gauntlet_index_1-bmv2-frontend.p4 | 3 - .../gauntlet_index_4-bmv2-frontend.p4 | 1 - .../gauntlet_index_7-bmv2-frontend.p4 | 7 - .../gauntlet_index_8-bmv2-frontend.p4 | 6 - .../gauntlet_infinite_loop.p4-stderr | 7 + .../gauntlet_int_casting-bmv2-frontend.p4 | 3 - ...gauntlet_invalid_hdr_assign-bmv2.p4-stderr | 4 + ...invalid_hdr_short_circuit-bmv2-frontend.p4 | 7 - ...t_invalid_hdr_short_circuit-bmv2.p4-stderr | 3 + .../gauntlet_mux_hdr-bmv2-frontend.p4 | 3 - .../gauntlet_mux_validity-bmv2-frontend.p4 | 3 - ...et_nested_ifs_in_function-bmv2-frontend.p4 | 3 - ...untlet_nested_table_calls-bmv2-frontend.p4 | 3 - .../gauntlet_return_truncate-bmv2-frontend.p4 | 5 - ...let_set_valid_in_function-bmv2-frontend.p4 | 3 - .../gauntlet_short_circuit-bmv2-frontend.p4 | 3 - .../gauntlet_short_circuit-bmv2.p4-stderr | 4 + ...ntlet_side_effect_order_1-bmv2-frontend.p4 | 4 - ...auntlet_side_effect_order_1-bmv2.p4-stderr | 5 + ...ntlet_side_effect_order_2-bmv2-frontend.p4 | 2 - ...auntlet_side_effect_order_2-bmv2.p4-stderr | 3 + ...ntlet_side_effect_order_3-bmv2-frontend.p4 | 11 -- ...auntlet_side_effect_order_3-bmv2.p4-stderr | 3 + ...ntlet_side_effect_order_4-bmv2-frontend.p4 | 5 - ...ntlet_side_effect_order_5-bmv2-frontend.p4 | 9 -- ...auntlet_side_effect_order_5-bmv2-midend.p4 | 14 -- ...auntlet_side_effect_order_5-bmv2.p4-stderr | 2 + ...ntlet_side_effects_in_mux-bmv2-frontend.p4 | 6 - ...auntlet_side_effects_in_mux-bmv2.p4-stderr | 4 + ...t_switch_nested_table_apply-bmv2.p4-stderr | 3 + ...gauntlet_switch_shadowing-bmv2-frontend.p4 | 5 - .../gauntlet_switch_shadowing-bmv2.p4-stderr | 2 + ...t_uninitialized_bool_struct-bmv2.p4-stderr | 6 + .../global_action_after_exit-frontend.p4 | 4 - .../global_action_after_exit-midend.p4 | 3 +- .../inline-control1-frontend.p4 | 4 +- .../inline-control1-midend.p4 | 2 +- .../inline-function-frontend.p4 | 6 - .../inline-switch-frontend.p4 | 4 - .../inline-switch.p4-stderr | 6 + .../invalid-hdr-warnings2-first.p4 | 1 + .../invalid-hdr-warnings2-frontend.p4 | 1 + .../invalid-hdr-warnings2-midend.p4 | 1 + .../invalid-hdr-warnings4-frontend.p4 | 33 ---- .../invalid-hdr-warnings4-midend.p4 | 54 ------- .../invalid-hdr-warnings8-frontend.p4 | 6 - .../invalid-hdr-warnings8-midend.p4 | 1 - .../issue-3312-graph-bmv2-frontend.p4 | 2 - .../issue-3312-graph-bmv2-midend.p4 | 2 - .../issue1001-bmv2-first.p4 | 3 +- .../issue1001-bmv2-frontend.p4 | 3 +- .../issue1001-bmv2-midend.p4 | 3 +- .../p4_16_samples_outputs/issue1001-bmv2.p4 | 3 +- .../issue1334-frontend.p4 | 2 - .../issue1452-1-frontend.p4 | 4 - .../issue1452-frontend.p4 | 8 - .../issue1466-frontend.p4 | 1 - .../p4_16_samples_outputs/issue1466-midend.p4 | 1 - .../issue1520-bmv2-frontend.p4 | 1 - .../issue1520-bmv2-midend.p4 | 1 - .../issue1538-frontend.p4 | 18 --- .../issue1544-1-bmv2-frontend.p4 | 3 - .../issue1544-2-bmv2-frontend.p4 | 3 - .../issue1544-2-frontend.p4 | 9 -- .../issue1544-bmv2-frontend.p4 | 4 - .../issue1642-bmv2-first.p4 | 3 +- .../issue1642-bmv2-frontend.p4 | 3 +- .../issue1642-bmv2-midend.p4 | 9 +- .../issue1653-bmv2-first.p4 | 1 + .../issue1653-bmv2-frontend.p4 | 1 + .../issue1653-bmv2-midend.p4 | 1 + .../p4_16_samples_outputs/issue1653-bmv2.p4 | 1 + .../issue1653-complex-bmv2-first.p4 | 3 +- .../issue1653-complex-bmv2-frontend.p4 | 3 +- .../issue1653-complex-bmv2-midend.p4 | 25 +-- .../issue1653-complex-bmv2.p4 | 3 +- .../issue1717-frontend.p4 | 3 - .../p4_16_samples_outputs/issue1717.p4-stderr | 4 + .../issue1765-1-bmv2-first.p4 | 11 +- .../issue1765-1-bmv2-frontend.p4 | 11 +- .../issue1765-1-bmv2-midend.p4 | 15 +- .../issue1781-bmv2-frontend.p4 | 14 -- .../issue1879-bmv2-frontend.p4 | 7 - .../issue1897-bmv2.p4-stderr | 4 + .../issue1985-frontend.p4 | 2 - .../issue2104-1-frontend.p4 | 5 - .../issue2104-frontend.p4 | 3 - .../issue2148-frontend.p4 | 15 -- .../issue2176-bmv2-frontend.p4 | 13 -- .../issue2176-bmv2-midend.p4 | 20 +-- .../issue2176-bmv2.p4-stderr | 4 +- .../issue2205-1-bmv2-frontend.p4 | 4 - .../issue2205-bmv2-frontend.p4 | 7 - .../issue2221-bmv2-frontend.p4 | 30 ---- .../issue2221-bmv2-midend.p4 | 2 - .../issue2225-bmv2-frontend.p4 | 2 - .../issue2258-bmv2-frontend.p4 | 3 - .../issue2260-2-frontend.p4 | 5 - .../issue2261-frontend.p4 | 3 - .../issue2266-frontend.p4 | 7 - .../issue2279-frontend.p4 | 1 - .../p4_16_samples_outputs/issue2279-midend.p4 | 1 - .../issue2279_1-frontend.p4 | 2 - .../issue2279_1-midend.p4 | 2 - .../issue2279_2-frontend.p4 | 2 - .../issue2279_2-midend.p4 | 1 - .../issue2279_3-frontend.p4 | 3 - .../issue2279_3-midend.p4 | 1 - .../issue2287-bmv2-frontend.p4 | 142 ------------------ .../issue2287-bmv2-midend.p4 | 2 - .../issue2288-1-frontend.p4 | 8 - .../issue2288-2-frontend.p4 | 13 -- .../issue2288-frontend.p4 | 29 ---- .../p4_16_samples_outputs/issue2288-midend.p4 | 13 -- .../issue2289-frontend.p4 | 24 --- .../p4_16_samples_outputs/issue2289.p4-stderr | 3 + .../issue2291-bmv2-frontend.p4 | 29 ---- .../issue232-bmv2-frontend.p4 | 8 - .../issue2321-frontend.p4 | 6 - .../issue2330-1-frontend.p4 | 3 - .../issue2330-1-midend.p4 | 3 - .../issue2343-bmv2-frontend.p4 | 4 - .../issue2344-frontend.p4 | 3 - .../issue2355-frontend.p4 | 16 -- .../issue2356-frontend.p4 | 5 - .../issue2375-1-bmv2-frontend.p4 | 13 -- .../issue2375-bmv2-frontend.p4 | 8 - .../issue2383-bmv2-frontend.p4 | 3 - .../issue2393-frontend.p4 | 17 --- .../p4_16_samples_outputs/issue2393-midend.p4 | 17 --- .../p4_16_samples_outputs/issue2393.p4-stderr | 4 + .../issue2488-bmv2-frontend.p4 | 16 -- .../issue2488-bmv2-midend.p4 | 6 +- .../issue2498-bmv2-frontend.p4 | 2 - .../issue2498-bmv2-midend.p4 | 18 +-- .../issue2543-1-frontend.p4 | 9 -- .../issue2543-1-midend.p4 | 13 +- .../issue2543-2-frontend.p4 | 6 - .../issue2797_ebpf-frontend.p4 | 3 - .../issue2900-frontend.p4 | 3 - .../issue2956-frontend.p4 | 2 - .../p4_16_samples_outputs/issue2956-midend.p4 | 2 - .../issue2957-frontend.p4 | 3 - .../issue3001-1-frontend.p4 | 9 -- .../issue3001-frontend.p4 | 5 - .../issue3051-frontend.p4 | 2 - .../p4_16_samples_outputs/issue3051-midend.p4 | 11 -- .../p4_16_samples_outputs/issue3051.p4-stderr | 1 + .../issue3219-frontend.p4 | 3 - .../issue323-frontend.p4 | 3 - .../p4_16_samples_outputs/issue323-midend.p4 | 1 - ...3274-1-FrontEnd_41_SimplifyDefUse-first.p4 | 12 ++ ...4-1-FrontEnd_41_SimplifyDefUse-frontend.p4 | 9 ++ ...274-1-FrontEnd_41_SimplifyDefUse-midend.p4 | 9 ++ .../issue3274-1-FrontEnd_41_SimplifyDefUse.p4 | 12 ++ ...274-1-FrontEnd_41_SimplifyDefUse.p4-stderr | 0 .../issue3274-frontend.p4 | 3 - .../issue3287-frontend.p4 | 3 - .../issue3291-1-frontend.p4 | 6 - .../issue3394-frontend.p4 | 5 - .../issue420-frontend.p4 | 3 - .../issue562-bmv2-first.p4 | 3 +- .../issue562-bmv2-frontend.p4 | 3 +- .../issue562-bmv2-midend.p4 | 9 +- .../p4_16_samples_outputs/issue562-bmv2.p4 | 3 +- ...non-zero-arg-default-action-08-frontend.p4 | 1 - ...k-non-zero-arg-default-action-08-midend.p4 | 8 +- .../mux-bmv2-frontend.p4 | 15 -- .../named-arg1-frontend.p4 | 22 --- .../named-arg1-midend.p4 | 19 +-- .../next-def-use.p4-stderr | 3 + .../parser-arg-frontend.p4 | 1 + .../parser-conditional.p4-stderr | 6 + .../parser-inline-test13-frontend.p4 | 7 - .../parser-inline-test13-midend.p4 | 7 - .../parser-inline-test13.p4-stderr | 12 ++ .../parser-inline-test2-frontend.p4 | 1 - .../parser-inline-test2-midend.p4 | 1 - .../parser-inline-test5-frontend.p4 | 2 - .../parser-inline-test5-midend.p4 | 2 - .../parser-inline-test6-frontend.p4 | 2 - .../parser-inline-test6-midend.p4 | 2 - .../pna-dpdk-parser-state-err-frontend.p4 | 3 - .../pna-example-tunnel-frontend.p4 | 3 - .../pna-mux-dismantle-frontend.p4 | 3 - .../p4_16_samples_outputs/pred-frontend.p4 | 2 - .../p4_16_samples_outputs/pred1-frontend.p4 | 4 - .../predication_issue_1-frontend.p4 | 3 - .../predication_issue_2-frontend.p4 | 3 - .../predication_issue_3-frontend.p4 | 3 - .../predication_issue_4-frontend.p4 | 3 - .../predication_issue_4-midend.p4 | 3 - ...non-zero-arg-default-action-08-frontend.p4 | 1 - ...k-non-zero-arg-default-action-08-midend.p4 | 6 +- ...pdk-non-zero-arg-default-action-08.p4.spec | 10 +- .../psa-example-digest-bmv2.p4-stderr | 12 ++ ...-example-dpdk-byte-alignment_1-frontend.p4 | 4 +- ...sa-example-dpdk-byte-alignment_1-midend.p4 | 2 + ...-example-dpdk-byte-alignment_2-frontend.p4 | 4 +- ...sa-example-dpdk-byte-alignment_2-midend.p4 | 2 + ...-example-dpdk-byte-alignment_3-frontend.p4 | 4 +- ...sa-example-dpdk-byte-alignment_3-midend.p4 | 2 + ...-example-dpdk-byte-alignment_5-frontend.p4 | 4 +- ...sa-example-dpdk-byte-alignment_5-midend.p4 | 2 + ...-example-dpdk-byte-alignment_6-frontend.p4 | 4 +- ...sa-example-dpdk-byte-alignment_6-midend.p4 | 2 + ...-example-dpdk-byte-alignment_7-frontend.p4 | 4 +- ...sa-example-dpdk-byte-alignment_7-midend.p4 | 2 + ...-example-dpdk-byte-alignment_8-frontend.p4 | 4 +- ...sa-example-dpdk-byte-alignment_8-midend.p4 | 2 + ...-example-dpdk-byte-alignment_9-frontend.p4 | 4 +- ...sa-example-dpdk-byte-alignment_9-midend.p4 | 2 + .../psa-example-dpdk-externs-frontend.p4 | 4 +- .../psa-example-dpdk-externs-midend.p4 | 2 + .../psa-example-dpdk-meter-frontend.p4 | 4 +- .../psa-example-dpdk-meter-midend.p4 | 2 + .../psa-example-dpdk-meter1-frontend.p4 | 4 +- .../psa-example-dpdk-meter1-midend.p4 | 2 + .../psa-variable-index-frontend.p4 | 3 - .../simple-firewall_ubpf-frontend.p4 | 4 - .../simplify_method_calls-frontend.p4 | 62 -------- .../simplify_method_calls-midend.p4 | 14 +- .../structArg-frontend.p4 | 3 - .../struct_init-1-frontend.p4 | 1 - .../struct_init-1-midend.p4 | 1 - .../two-functions-frontend.p4 | 10 -- .../vss-example.p4-stderr | 15 ++ 254 files changed, 316 insertions(+), 1305 deletions(-) create mode 100644 testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-first.p4 create mode 100644 testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-frontend.p4 create mode 100644 testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-midend.p4 create mode 100644 testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse.p4 create mode 100644 testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse.p4-stderr diff --git a/testdata/p4_14_samples_outputs/action_inline1-frontend.p4 b/testdata/p4_14_samples_outputs/action_inline1-frontend.p4 index d8ca39abdb..05efcb6c7b 100644 --- a/testdata/p4_14_samples_outputs/action_inline1-frontend.p4 +++ b/testdata/p4_14_samples_outputs/action_inline1-frontend.p4 @@ -32,7 +32,6 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @noWarn("unused") @name(".NoAction") action NoAction_1() { } @name(".setb1") action setb1(@name("val") bit<8> val, @name("port") bit<9> port) { - dest = hdr.data.b1; dest = val; hdr.data.b1 = dest; standard_metadata.egress_spec = port; diff --git a/testdata/p4_14_samples_outputs/action_inline2-frontend.p4 b/testdata/p4_14_samples_outputs/action_inline2-frontend.p4 index 2d9d32b820..cc8a259ee6 100644 --- a/testdata/p4_14_samples_outputs/action_inline2-frontend.p4 +++ b/testdata/p4_14_samples_outputs/action_inline2-frontend.p4 @@ -34,9 +34,6 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @noWarn("unused") @name(".NoAction") action NoAction_1() { } @name(".setb1") action setb1(@name("port") bit<9> port) { - dest = hdr.data.b1; - dest_3 = dest; - dest_4 = dest_3; dest_4 = hdr.data.b2; dest_3 = dest_4; dest = dest_3; diff --git a/testdata/p4_16_samples_outputs/action-bind-frontend.p4 b/testdata/p4_16_samples_outputs/action-bind-frontend.p4 index 4d352bd346..6444d81d4e 100644 --- a/testdata/p4_16_samples_outputs/action-bind-frontend.p4 +++ b/testdata/p4_16_samples_outputs/action-bind-frontend.p4 @@ -1,7 +1,6 @@ control c(inout bit<32> x) { @name("c.b") bit<32> b_0; @name("c.a") action a(@name("d") bit<32> d) { - b_0 = x; b_0 = d; x = b_0; } diff --git a/testdata/p4_16_samples_outputs/action_call_ubpf-frontend.p4 b/testdata/p4_16_samples_outputs/action_call_ubpf-frontend.p4 index 1732ca4781..72c23a5c2b 100644 --- a/testdata/p4_16_samples_outputs/action_call_ubpf-frontend.p4 +++ b/testdata/p4_16_samples_outputs/action_call_ubpf-frontend.p4 @@ -14,13 +14,10 @@ parser prs(packet_in p, out Headers_t headers, inout metadata meta, inout standa } control pipe(inout Headers_t headers, inout metadata meta, inout standard_metadata std_meta) { - @name("pipe.hasReturned") bool hasReturned; @name("pipe.RejectConditional") action RejectConditional(@name("condition") bit<1> condition) { } @name("pipe.act_return") action act_return() { - hasReturned = false; mark_to_pass(); - hasReturned = true; } @name("pipe.act_exit") action act_exit() { mark_to_pass(); diff --git a/testdata/p4_16_samples_outputs/after-return-frontend.p4 b/testdata/p4_16_samples_outputs/after-return-frontend.p4 index 40ce33401f..b38519c69d 100644 --- a/testdata/p4_16_samples_outputs/after-return-frontend.p4 +++ b/testdata/p4_16_samples_outputs/after-return-frontend.p4 @@ -1,14 +1,7 @@ control ctrl() { @name("ctrl.a") bit<32> a_0; - @name("ctrl.hasReturned") bool hasReturned; apply { - hasReturned = false; a_0 = 32w0; - if (a_0 == 32w0) { - hasReturned = true; - } else { - hasReturned = true; - } } } diff --git a/testdata/p4_16_samples_outputs/control-as-param-frontend.p4 b/testdata/p4_16_samples_outputs/control-as-param-frontend.p4 index 39727e87eb..7cf0478956 100644 --- a/testdata/p4_16_samples_outputs/control-as-param-frontend.p4 +++ b/testdata/p4_16_samples_outputs/control-as-param-frontend.p4 @@ -3,7 +3,6 @@ control E(out bit<1> b); control Ingress(out bit<1> b) { apply { - b = 1w1; b = 1w0; } } diff --git a/testdata/p4_16_samples_outputs/control-as-param-midend.p4 b/testdata/p4_16_samples_outputs/control-as-param-midend.p4 index ed91aca50d..8bfa518bbd 100644 --- a/testdata/p4_16_samples_outputs/control-as-param-midend.p4 +++ b/testdata/p4_16_samples_outputs/control-as-param-midend.p4 @@ -2,18 +2,17 @@ control E(out bit<1> b); control Ingress(out bit<1> b) { - @hidden action controlasparam7() { - b = 1w1; + @hidden action controlasparam13() { b = 1w0; } - @hidden table tbl_controlasparam7 { + @hidden table tbl_controlasparam13 { actions = { - controlasparam7(); + controlasparam13(); } - const default_action = controlasparam7(); + const default_action = controlasparam13(); } apply { - tbl_controlasparam7.apply(); + tbl_controlasparam13.apply(); } } diff --git a/testdata/p4_16_samples_outputs/decl2-frontend.p4 b/testdata/p4_16_samples_outputs/decl2-frontend.p4 index 208c58e0fc..54d99c7cc1 100644 --- a/testdata/p4_16_samples_outputs/decl2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/decl2-frontend.p4 @@ -1,19 +1,7 @@ control p() { - @name("p.z") bit<1> z_0; - @name("p.x_0") bit<1> x_0; - @name("p.x_1") bit<1> x_3; - @name("p.y_0") bit<1> y_0; - @name("p.x") bit<1> x_4; - @name("p.y") bit<1> y_2; @name("p.b") action b() { - x_4 = x_3; - x_0 = x_4; - z_0 = x_4 & x_0; - y_2 = z_0; - y_0 = y_2; } apply { - x_3 = 1w0; b(); } } diff --git a/testdata/p4_16_samples_outputs/def-use-frontend.p4 b/testdata/p4_16_samples_outputs/def-use-frontend.p4 index 97316746a8..d1bbef5fbf 100644 --- a/testdata/p4_16_samples_outputs/def-use-frontend.p4 +++ b/testdata/p4_16_samples_outputs/def-use-frontend.p4 @@ -21,7 +21,6 @@ control IngressI(inout H hdr, inout M meta, inout std_meta_t std_meta) { } control EgressI(inout H hdr, inout M meta, inout std_meta_t std_meta) { - @name("EgressI.hasReturned") bool hasReturned; @name("EgressI.a") action a() { } @name("EgressI.t") table t_0 { @@ -31,10 +30,8 @@ control EgressI(inout H hdr, inout M meta, inout std_meta_t std_meta) { default_action = a(); } apply { - hasReturned = false; switch (t_0.apply().action_run) { a: { - hasReturned = true; } default: { } diff --git a/testdata/p4_16_samples_outputs/function-frontend.p4 b/testdata/p4_16_samples_outputs/function-frontend.p4 index 9854e79fe3..61b6098711 100644 --- a/testdata/p4_16_samples_outputs/function-frontend.p4 +++ b/testdata/p4_16_samples_outputs/function-frontend.p4 @@ -14,7 +14,6 @@ control c(out bit<16> b) { if (hasReturned) { ; } else { - hasReturned = true; retval = right; } b = retval; diff --git a/testdata/p4_16_samples_outputs/function.p4-stderr b/testdata/p4_16_samples_outputs/function.p4-stderr index e69de29bb2..063aefea8a 100644 --- a/testdata/p4_16_samples_outputs/function.p4-stderr +++ b/testdata/p4_16_samples_outputs/function.p4-stderr @@ -0,0 +1,2 @@ +[--Wwarn=uninitialized_use] warning: retval may be uninitialized +[--Wwarn=uninitialized_use] warning: retval may be uninitialized diff --git a/testdata/p4_16_samples_outputs/gauntlet_action_return-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_action_return-bmv2-frontend.p4 index b3f7981e53..262c9af7e7 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_action_return-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_action_return-bmv2-frontend.p4 @@ -35,11 +35,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { } else { val_0 = 8w3; } - if (hasReturned) { - ; - } else { - hasReturned = true; - } h.h.a = val_0; } @name("ingress.simple_table") table simple_table_0 { diff --git a/testdata/p4_16_samples_outputs/gauntlet_arithref_cast-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_arithref_cast-bmv2-frontend.p4 index 2c48b16307..a649fcc70b 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_arithref_cast-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_arithref_cast-bmv2-frontend.p4 @@ -26,13 +26,10 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp") bit<48> tmp; @name("ingress.tmp_0") bit<8> tmp_0; @name("ingress.tmp_1") bit<48> tmp_1; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<8> retval; apply { if (h.eth_hdr.src_addr < 48w10) { tmp = h.eth_hdr.dst_addr; - hasReturned = false; - hasReturned = true; retval = 8w2; tmp_0 = retval; tmp_1 = tmp << tmp_0; diff --git a/testdata/p4_16_samples_outputs/gauntlet_copy_out-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_copy_out-bmv2-frontend.p4 index ecbf97c424..ad0b045cbf 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_copy_out-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_copy_out-bmv2-frontend.p4 @@ -27,13 +27,11 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.inout_c") bit<8> inout_c_2; @name("ingress.do_thing") action do_thing() { inout_c_0 = c_0; - h.h.a = inout_c_0; c_0 = inout_c_0; } @name("ingress.do_thing") action do_thing_1() { inout_c_2 = c_0; h.h.a = inout_c_2; - c_0 = inout_c_2; } apply { c_0 = 8w12; diff --git a/testdata/p4_16_samples_outputs/gauntlet_copy_out-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/gauntlet_copy_out-bmv2-midend.p4 index f831133016..ea0d88b803 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_copy_out-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_copy_out-bmv2-midend.p4 @@ -23,9 +23,9 @@ struct Meta { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.do_thing") action do_thing() { - h.h.a = 8w12; } @name("ingress.do_thing") action do_thing_1() { + h.h.a = 8w12; } @hidden table tbl_do_thing { actions = { diff --git a/testdata/p4_16_samples_outputs/gauntlet_exit_combination_18-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_exit_combination_18-bmv2-frontend.p4 index cdb9519628..56955c3a68 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_exit_combination_18-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_exit_combination_18-bmv2-frontend.p4 @@ -28,7 +28,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { dummy_0 = h.eth_hdr.src_addr; h.eth_hdr.src_addr = dummy_0; exit; - h.eth_hdr.src_addr = dummy_0; } apply { simple_action(); diff --git a/testdata/p4_16_samples_outputs/gauntlet_exit_combination_20-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_exit_combination_20-bmv2-frontend.p4 index 5623ac15a8..7e33d8278b 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_exit_combination_20-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_exit_combination_20-bmv2-frontend.p4 @@ -23,10 +23,7 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.hasReturned") bool hasReturned; @name("ingress.simple_action") action simple_action() { - hasReturned = false; - hasReturned = true; } apply { simple_action(); diff --git a/testdata/p4_16_samples_outputs/gauntlet_exit_combination_3-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_exit_combination_3-bmv2-frontend.p4 index f93106df48..f8fa4f16e9 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_exit_combination_3-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_exit_combination_3-bmv2-frontend.p4 @@ -29,18 +29,14 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @noWarn("unused") @name(".NoAction") action NoAction_1() { } @name("ingress.do_action") action do_action() { - val_0 = h.eth_hdr.src_addr; val_0 = 48w2; h.eth_hdr.src_addr = val_0; exit; - h.eth_hdr.src_addr = val_0; } @name("ingress.do_action") action do_action_1() { - val_2 = h.eth_hdr.dst_addr; val_2 = 48w2; h.eth_hdr.dst_addr = val_2; exit; - h.eth_hdr.dst_addr = val_2; } @name("ingress.simple_table") table simple_table_0 { key = { diff --git a/testdata/p4_16_samples_outputs/gauntlet_exit_combination_8-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_exit_combination_8-bmv2-frontend.p4 index 08d4974baf..5fc1659948 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_exit_combination_8-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_exit_combination_8-bmv2-frontend.p4 @@ -23,10 +23,7 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.hasReturned") bool hasReturned; apply { - hasReturned = false; - hasReturned = true; } } diff --git a/testdata/p4_16_samples_outputs/gauntlet_function_if_hdr_return-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_function_if_hdr_return-bmv2-frontend.p4 index 3b40ec3574..cb5161a67f 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_function_if_hdr_return-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_function_if_hdr_return-bmv2-frontend.p4 @@ -23,11 +23,8 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") ethernet_t retval; apply { - hasReturned = false; - hasReturned = true; retval.setValid(); retval = (ethernet_t){dst_addr = 48w1,src_addr = 48w1,eth_type = 16w1}; h.eth_hdr = retval; diff --git a/testdata/p4_16_samples_outputs/gauntlet_function_return-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_function_return-bmv2-frontend.p4 index 4815857c1d..1f3293e2bd 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_function_return-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_function_return-bmv2-frontend.p4 @@ -16,15 +16,9 @@ struct Meta { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp") bit<8> tmp; @name("ingress.c") bit<32> c_0; - @name("ingress.d_0") bit<32> d; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<8> retval; @name("ingress.action_thing") action action_thing() { - c_0 = sm.enq_timestamp; - hasReturned = false; - hasReturned = true; retval = 8w1; - c_0 = d; tmp = retval; c_0 = (bit<32>)tmp; sm.enq_timestamp = c_0; diff --git a/testdata/p4_16_samples_outputs/gauntlet_function_return-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/gauntlet_function_return-bmv2.p4-stderr index 4ddf32131b..64edd38594 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_function_return-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/gauntlet_function_return-bmv2.p4-stderr @@ -4,3 +4,4 @@ bit<8> do_thing(out bit<32> d) { gauntlet_function_return-bmv2.p4(15) bit<8> do_thing(out bit<32> d) { ^^^^^^^^ +[--Wwarn=uninitialized_use] warning: d_0 may be uninitialized diff --git a/testdata/p4_16_samples_outputs/gauntlet_function_return_cast-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_function_return_cast-bmv2-frontend.p4 index 076aea432b..edb0210cca 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_function_return_cast-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_function_return_cast-bmv2-frontend.p4 @@ -24,11 +24,8 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp") bit<8> tmp; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<8> retval; apply { - hasReturned = false; - hasReturned = true; retval = 8w255; tmp = retval; h.eth_hdr.eth_type = (bit<16>)tmp; diff --git a/testdata/p4_16_samples_outputs/gauntlet_hdr_function_cast-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_hdr_function_cast-bmv2-frontend.p4 index ca98d31a9d..873b3efd2c 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_hdr_function_cast-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_hdr_function_cast-bmv2-frontend.p4 @@ -28,7 +28,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.val_0") bit<16> val; @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") ethernet_t retval; - @name("ingress.hasReturned_0") bool hasReturned_0; @name("ingress.retval_0") ethernet_t retval_0; apply { val = h.eth_hdr1.eth_type; @@ -45,14 +44,10 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { if (hasReturned) { ; } else { - hasReturned = true; retval.setValid(); retval = (ethernet_t){dst_addr = 48w3,src_addr = 48w3,eth_type = 16w3}; } - h.eth_hdr1.eth_type = val; h.eth_hdr1 = retval; - hasReturned_0 = false; - hasReturned_0 = true; retval_0.setValid(); retval_0 = (ethernet_t){dst_addr = 48w1,src_addr = 48w1,eth_type = 16w1}; h.eth_hdr2 = retval_0; diff --git a/testdata/p4_16_samples_outputs/gauntlet_hdr_function_cast-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/gauntlet_hdr_function_cast-bmv2-midend.p4 index 703a0b3154..a34bc72628 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_hdr_function_cast-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_hdr_function_cast-bmv2-midend.p4 @@ -46,7 +46,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { hasReturned = false; } @hidden action gauntlet_hdr_function_castbmv2l26() { - hasReturned = true; retval.setValid(); retval.dst_addr = 48w3; retval.src_addr = 48w3; diff --git a/testdata/p4_16_samples_outputs/gauntlet_hdr_function_cast-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/gauntlet_hdr_function_cast-bmv2.p4-stderr index e69de29bb2..1ef8df559f 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_hdr_function_cast-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/gauntlet_hdr_function_cast-bmv2.p4-stderr @@ -0,0 +1,2 @@ +[--Wwarn=uninitialized_use] warning: retval may not be completely initialized +[--Wwarn=uninitialized_use] warning: retval may not be completely initialized diff --git a/testdata/p4_16_samples_outputs/gauntlet_hdr_out_in_action-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/gauntlet_hdr_out_in_action-bmv2.p4-stderr index 58f9d10c3b..058264e1b8 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_hdr_out_in_action-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/gauntlet_hdr_out_in_action-bmv2.p4-stderr @@ -1,3 +1,6 @@ gauntlet_hdr_out_in_action-bmv2.p4(35): [--Wwarn=unused] warning: 'val' is unused action do_action(out ethernet_t val) { ^^^ +gauntlet_hdr_out_in_action-bmv2.p4(35): [--Wwarn=uninitialized_use] warning: val may not be completely initialized + action do_action(out ethernet_t val) { + ^^^ diff --git a/testdata/p4_16_samples_outputs/gauntlet_index_1-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_index_1-bmv2-frontend.p4 index bb4c874090..4a71dd7c7b 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_index_1-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_index_1-bmv2-frontend.p4 @@ -41,19 +41,16 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp_1") bit<3> tmp_0; @name("ingress.val_0") bit<3> val; @name("ingress.bound_val_0") bit<3> bound_val; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<3> retval; @name("ingress.tmp") bit<3> tmp_1; apply { val = h.i.a; bound_val = 3w1; - hasReturned = false; if (val > bound_val) { tmp_1 = bound_val; } else { tmp_1 = val; } - hasReturned = true; retval = tmp_1; tmp = retval; tmp_0 = tmp; diff --git a/testdata/p4_16_samples_outputs/gauntlet_index_4-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_index_4-bmv2-frontend.p4 index d1055110eb..49e785391e 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_index_4-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_index_4-bmv2-frontend.p4 @@ -33,7 +33,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp") bit<32> tmp; @name("ingress.val") bit<32> val_0; @name("ingress.do_something") action do_something() { - val_0 = h.h[0].a; if (h.eth_hdr.eth_type == 16w1) { tmp = 32w1; } else { diff --git a/testdata/p4_16_samples_outputs/gauntlet_index_7-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_index_7-bmv2-frontend.p4 index 88924d113f..2dc45b3f08 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_index_7-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_index_7-bmv2-frontend.p4 @@ -40,22 +40,15 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp") bit<1> tmp; @name("ingress.tmp_0") bit<1> tmp_0; @name("ingress.val_0") bit<1> val; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<1> retval; @name("ingress.id_0") bit<1> id_1; - @name("ingress.hasReturned_0") bool hasReturned_0; @name("ingress.retval_0") bit<8> retval_0; apply { val = h.i.id; - hasReturned = false; - hasReturned = true; retval = val; tmp = retval; tmp_0 = tmp; - id_1 = h.i.id; - hasReturned_0 = false; id_1 = 1w0; - hasReturned_0 = true; retval_0 = 8w1; h.i.id = id_1; h.h[tmp_0].a = retval_0; diff --git a/testdata/p4_16_samples_outputs/gauntlet_index_8-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_index_8-bmv2-frontend.p4 index f12d34185f..b0f9d0998f 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_index_8-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_index_8-bmv2-frontend.p4 @@ -44,22 +44,16 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp_2") bit<1> tmp_2; @name("ingress.tmp_3") bit<1> tmp_3; @name("ingress.val_0") bit<1> val; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<1> retval; @name("ingress.val_1") bit<8> val_2; - @name("ingress.hasReturned_0") bool hasReturned_0; @name("ingress.retval_0") bit<1> retval_0; apply { val = h.i.idx; - hasReturned = false; - hasReturned = true; retval = val; tmp = retval; tmp_0 = tmp; tmp_1 = h.h[tmp_0].a; val_2 = tmp_1; - hasReturned_0 = false; - hasReturned_0 = true; retval_0 = 1w0; tmp_1 = val_2; tmp_2 = retval_0; diff --git a/testdata/p4_16_samples_outputs/gauntlet_infinite_loop.p4-stderr b/testdata/p4_16_samples_outputs/gauntlet_infinite_loop.p4-stderr index e48e5ae4c0..9da58a1a36 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_infinite_loop.p4-stderr +++ b/testdata/p4_16_samples_outputs/gauntlet_infinite_loop.p4-stderr @@ -22,3 +22,10 @@ gauntlet_infinite_loop.p4(23): [--Wwarn=uninitialized_use] warning: padding.p ma gauntlet_infinite_loop.p4(23): [--Wwarn=invalid_header] warning: accessing a field of an invalid header padding transition select(padding.p) { ^^^^^^^ +[--Wwarn=uninitialized_use] warning: tmp may not be completely initialized +[--Wwarn=uninitialized_use] warning: tmp_0 may not be completely initialized +[--Wwarn=uninitialized_use] warning: tmp may not be completely initialized +[--Wwarn=uninitialized_use] warning: tmp_0 may not be completely initialized +[--Wwarn=invalid_header] warning: accessing a field of an invalid header tmp_0 +[--Wwarn=uninitialized_use] warning: tmp may not be completely initialized +[--Wwarn=uninitialized_use] warning: tmp_0 may not be completely initialized diff --git a/testdata/p4_16_samples_outputs/gauntlet_int_casting-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_int_casting-bmv2-frontend.p4 index 9379b65d49..5fc1659948 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_int_casting-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_int_casting-bmv2-frontend.p4 @@ -23,10 +23,7 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.hasReturned_0") bool hasReturned_0; apply { - hasReturned_0 = false; - hasReturned_0 = true; } } diff --git a/testdata/p4_16_samples_outputs/gauntlet_invalid_hdr_assign-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/gauntlet_invalid_hdr_assign-bmv2.p4-stderr index e69de29bb2..e34c776b88 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_invalid_hdr_assign-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/gauntlet_invalid_hdr_assign-bmv2.p4-stderr @@ -0,0 +1,4 @@ +[--Wwarn=uninitialized_use] warning: tmp_0 may not be completely initialized +gauntlet_invalid_hdr_assign-bmv2.p4(39): [--Wwarn=invalid_header] warning: accessing a field of a potentially invalid header h.h + h.eth_hdr.eth_type = (bit<16>)h.h.a; + ^^^ diff --git a/testdata/p4_16_samples_outputs/gauntlet_invalid_hdr_short_circuit-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_invalid_hdr_short_circuit-bmv2-frontend.p4 index a892b8df3a..f827b08c67 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_invalid_hdr_short_circuit-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_invalid_hdr_short_circuit-bmv2-frontend.p4 @@ -30,16 +30,9 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.dummy") bool dummy; @name("ingress.dummy_0") H dummy_2; - @name("ingress.hasReturned") bool hasReturned; - @name("ingress.retval") bool retval; apply { - hasReturned = false; - hasReturned = true; - retval = true; h.h = dummy_2; - dummy = retval; } } diff --git a/testdata/p4_16_samples_outputs/gauntlet_invalid_hdr_short_circuit-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/gauntlet_invalid_hdr_short_circuit-bmv2.p4-stderr index e69de29bb2..4941ee95f5 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_invalid_hdr_short_circuit-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/gauntlet_invalid_hdr_short_circuit-bmv2.p4-stderr @@ -0,0 +1,3 @@ +[--Wwarn=uninitialized_use] warning: dummy_0 may not be completely initialized +[--Wwarn=uninitialized_use] warning: dummy_0 may not be completely initialized +[--Wwarn=uninitialized_use] warning: dummy_0 may not be completely initialized diff --git a/testdata/p4_16_samples_outputs/gauntlet_mux_hdr-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_mux_hdr-bmv2-frontend.p4 index ff24f9c02f..b192ace3c1 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_mux_hdr-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_mux_hdr-bmv2-frontend.p4 @@ -21,14 +21,12 @@ struct Meta { } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<32> retval; @name("ingress.tmp1") H[2] tmp1_0; @name("ingress.tmp2") H[2] tmp2_0; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @name("ingress.simple_action") action simple_action() { - hasReturned = false; tmp1_0[0].setInvalid(); tmp1_0[1].setInvalid(); tmp2_0[0].setInvalid(); @@ -36,7 +34,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { if (tmp2_0[0].a <= 32w3) { tmp1_0[0] = tmp2_0[1]; } - hasReturned = true; retval = tmp1_0[0].a; h.h.a = retval; } diff --git a/testdata/p4_16_samples_outputs/gauntlet_mux_validity-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_mux_validity-bmv2-frontend.p4 index 12f881e7e2..9488b6dd42 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_mux_validity-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_mux_validity-bmv2-frontend.p4 @@ -33,13 +33,10 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp") bit<16> tmp; @name("ingress.tmp_0") bit<16> tmp_0; @name("ingress.dummy_1") H dummy; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<16> retval; @name("ingress.dummy") action dummy_2() { if (b_0) { dummy = h.h; - hasReturned = false; - hasReturned = true; retval = 16w1; h.h = dummy; tmp_0 = retval; diff --git a/testdata/p4_16_samples_outputs/gauntlet_nested_ifs_in_function-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_nested_ifs_in_function-bmv2-frontend.p4 index c037c55c4d..73d9d62866 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_nested_ifs_in_function-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_nested_ifs_in_function-bmv2-frontend.p4 @@ -29,11 +29,8 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<8> retval; apply { - hasReturned = false; - hasReturned = true; retval = 8w1; h.h.a = retval; } diff --git a/testdata/p4_16_samples_outputs/gauntlet_nested_table_calls-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_nested_table_calls-bmv2-frontend.p4 index 35a6cc2142..a97b048fc7 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_nested_table_calls-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_nested_table_calls-bmv2-frontend.p4 @@ -27,7 +27,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp_0") bit<16> tmp_0; @name("ingress.tmp_1") bit<16> tmp_1; @name("ingress.input_value_0") bit<16> input_value; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<16> retval; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @@ -53,8 +52,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { } tmp_1 = tmp_0; input_value = tmp_1; - hasReturned = false; - hasReturned = true; retval = input_value; h.eth_hdr.eth_type = retval; } diff --git a/testdata/p4_16_samples_outputs/gauntlet_return_truncate-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_return_truncate-bmv2-frontend.p4 index a1e9ff562b..e561082739 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_return_truncate-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_return_truncate-bmv2-frontend.p4 @@ -25,13 +25,8 @@ struct Meta { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.y") bit<64> y_0; @name("ingress.tmp") bit<16> tmp; - @name("ingress.hyhe") bit<8> hyhe_0; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<16> retval; @name("ingress.iuJze") action iuJze() { - hyhe_0 = 8w2; - hasReturned = false; - hasReturned = true; retval = 16w4; tmp = retval; y_0 = (bit<64>)tmp; diff --git a/testdata/p4_16_samples_outputs/gauntlet_set_valid_in_function-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_set_valid_in_function-bmv2-frontend.p4 index 6fee8b38fb..3cf7e4a4e8 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_set_valid_in_function-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_set_valid_in_function-bmv2-frontend.p4 @@ -25,14 +25,11 @@ struct Meta { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp") bit<16> tmp; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<16> retval; @name("ingress.tmp_ret") H tmp_ret_0; apply { - hasReturned = false; tmp_ret_0.setValid(); tmp_ret_0 = (H){a = 8w0,b = 64w0,c = 16w0}; - hasReturned = true; retval = tmp_ret_0.c; tmp = retval; m.t = (bit<32>)tmp; diff --git a/testdata/p4_16_samples_outputs/gauntlet_short_circuit-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_short_circuit-bmv2-frontend.p4 index eae2c4aee3..2f6702a5e8 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_short_circuit-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_short_circuit-bmv2-frontend.p4 @@ -44,12 +44,9 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp_1") bool tmp_1; @name("ingress.tmp_2") bit<8> tmp_2; @name("ingress.val_0") bit<8> val; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<8> retval; apply { tmp = 8w1; - hasReturned = false; - hasReturned = true; retval = val; h.b.b = val; tmp_0 = retval; diff --git a/testdata/p4_16_samples_outputs/gauntlet_short_circuit-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/gauntlet_short_circuit-bmv2.p4-stderr index 6b96fbf174..cc87bede8a 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_short_circuit-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/gauntlet_short_circuit-bmv2.p4-stderr @@ -7,3 +7,7 @@ bit<8> do_function(out bit<8> val) { gauntlet_short_circuit-bmv2.p4(22) bit<8> do_function(out bit<8> val) { ^^^^^^^^^^^ +[--Wwarn=uninitialized_use] warning: val_0 may be uninitialized +[--Wwarn=uninitialized_use] warning: val_0 may be uninitialized +[--Wwarn=uninitialized_use] warning: val_0 may be uninitialized +[--Wwarn=uninitialized_use] warning: val_0 may be uninitialized diff --git a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_1-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_1-bmv2-frontend.p4 index da5dfd31b0..004e4fd11d 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_1-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_1-bmv2-frontend.p4 @@ -29,14 +29,10 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.tmp") bit<16> tmp; @name("ingress.tmp_0") bit<16> tmp_0; - @name("ingress.val_1") bit<16> val_1; @name("ingress.val_2") bit<16> val_3; @name("ingress.val") bit<16> val_4; @name("ingress.do_action_2") action do_action() { - val_1 = val_3; - tmp = val_1; tmp_0 = val_3; val_4 = tmp_0; h.h.a = val_4; diff --git a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_1-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_1-bmv2.p4-stderr index 28186ae2de..09ed2fb18d 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_1-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_1-bmv2.p4-stderr @@ -19,3 +19,8 @@ gauntlet_side_effect_order_1-bmv2.p4(33): [--Wwarn=uninitialized_out_param] warn gauntlet_side_effect_order_1-bmv2.p4(33) action do_action_1(out bit<16> val_1, out bit<16> val_2) { ^^^^^^^^^^^ +[--Wwarn=uninitialized_use] warning: val_1 may be uninitialized +[--Wwarn=uninitialized_use] warning: val_1 may be uninitialized +[--Wwarn=uninitialized_use] warning: val_1 may be uninitialized +[--Wwarn=uninitialized_use] warning: val_1 may be uninitialized +[--Wwarn=uninitialized_use] warning: val_1 may be uninitialized diff --git a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_2-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_2-bmv2-frontend.p4 index 25c690ddb2..8a47574684 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_2-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_2-bmv2-frontend.p4 @@ -31,12 +31,10 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp") bit<8> tmp_1; @name("ingress.tmp_1") bit<8> tmp_2; - @name("ingress.tmp") bit<8> tmp_4; @name("ingress.val_1") bit<8> val; @name("ingress.do_thing") action do_thing() { val = tmp_2; h.h.a = val; - tmp_1 = tmp_4; } apply { tmp_1 = 8w3; diff --git a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_2-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_2-bmv2.p4-stderr index 7792fba284..78d4b7ca9b 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_2-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_2-bmv2.p4-stderr @@ -7,3 +7,6 @@ gauntlet_side_effect_order_2-bmv2.p4(33): [--Wwarn=uninitialized_out_param] warn gauntlet_side_effect_order_2-bmv2.p4(33) action do_thing(out bit<8> tmp, in bit<8> val_1) { ^^^^^^^^ +gauntlet_side_effect_order_2-bmv2.p4(33): [--Wwarn=uninitialized_use] warning: tmp may be uninitialized + action do_thing(out bit<8> tmp, in bit<8> val_1) { + ^^^ diff --git a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_3-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_3-bmv2-frontend.p4 index 935319bb1f..e7ffcecb2a 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_3-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_3-bmv2-frontend.p4 @@ -32,20 +32,9 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.random_val_0") bit<8> random_val; - @name("ingress.val_0") bit<8> val; - @name("ingress.hasReturned") bool hasReturned; - @name("ingress.retval") bit<8> retval; @name("ingress.val_1") bit<8> val_2; - @name("ingress.hasReturned") bool hasReturned_1; @name("ingress.retval") bit<8> retval_1; apply { - hasReturned = false; - hasReturned = true; - retval = 8w1; - random_val = val; - hasReturned_1 = false; - hasReturned_1 = true; retval_1 = 8w1; m.tmp = val_2; h.h.a = retval_1; diff --git a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_3-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_3-bmv2.p4-stderr index 17e1f18c27..04ac2bf810 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_3-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_3-bmv2.p4-stderr @@ -4,3 +4,6 @@ bit<8> do_thing(out bit<8> val) { gauntlet_side_effect_order_3-bmv2.p4(25) bit<8> do_thing(out bit<8> val) { ^^^^^^^^ +[--Wwarn=uninitialized_use] warning: val_0 may be uninitialized +[--Wwarn=uninitialized_use] warning: val_1 may be uninitialized +[--Wwarn=uninitialized_use] warning: val_1 may be uninitialized diff --git a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_4-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_4-bmv2-frontend.p4 index 5f8cd94bf1..93b69f5772 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_4-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_4-bmv2-frontend.p4 @@ -17,20 +17,15 @@ struct Meta { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.val") bit<16> val_0; - @name("ingress.hasReturned") bool hasReturned; - @name("ingress.retval") bit<16> retval; @name("ingress.tmp") bit<16> tmp; apply { val_0 = h.eth_hdr.eth_type; - hasReturned = false; if (val_0 < 16w6) { tmp = 16w0; } else { tmp = 16w3; } val_0 = tmp; - hasReturned = true; - retval = 16w2; h.eth_hdr.eth_type = val_0; } } diff --git a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_5-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_5-bmv2-frontend.p4 index 71f7691e8a..75b1182a21 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_5-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_5-bmv2-frontend.p4 @@ -21,7 +21,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.val") bit<48> val_0; @name("ingress.val_2") bit<48> val_1; @name("ingress.hasReturned") bool hasReturned; - @name("ingress.retval") bit<48> retval; apply { tmp = h.eth_hdr.src_addr; val_0 = tmp; @@ -30,7 +29,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { if (val_0 <= 48w50) { val_1 = 48w3; hasReturned = true; - retval = 48w0; } else { val_1 = 48w12; } @@ -40,13 +38,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { val_1 = 48w1452; } } - if (hasReturned) { - ; - } else { - hasReturned = true; - retval = 48w0; - } - tmp = val_0; tmp_0 = val_1; h.eth_hdr.src_addr = tmp_0; } diff --git a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_5-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_5-bmv2-midend.p4 index 56b5f9cb71..eae0083eed 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_5-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_5-bmv2-midend.p4 @@ -31,9 +31,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @hidden action act() { hasReturned = false; } - @hidden action gauntlet_side_effect_order_5bmv2l28() { - hasReturned = true; - } @hidden action act_0() { h.eth_hdr.src_addr = val_1; } @@ -61,12 +58,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { } const default_action = gauntlet_side_effect_order_5bmv2l25(); } - @hidden table tbl_gauntlet_side_effect_order_5bmv2l28 { - actions = { - gauntlet_side_effect_order_5bmv2l28(); - } - const default_action = gauntlet_side_effect_order_5bmv2l28(); - } @hidden table tbl_act_0 { actions = { act_0(); @@ -87,11 +78,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { tbl_gauntlet_side_effect_order_5bmv2l25.apply(); } } - if (hasReturned) { - ; - } else { - tbl_gauntlet_side_effect_order_5bmv2l28.apply(); - } tbl_act_0.apply(); } } diff --git a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_5-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_5-bmv2.p4-stderr index 84aa894f11..41c112210c 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_5-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/gauntlet_side_effect_order_5-bmv2.p4-stderr @@ -16,3 +16,5 @@ bit<48> do_thing(inout bit<48> val_0, out bit<48> val_1) { gauntlet_side_effect_order_5-bmv2.p4(16) bit<48> do_thing(inout bit<48> val_0, out bit<48> val_1) { ^^^^^^^^ +[--Wwarn=uninitialized_use] warning: val_2 may be uninitialized +[--Wwarn=uninitialized_use] warning: val_2 may be uninitialized diff --git a/testdata/p4_16_samples_outputs/gauntlet_side_effects_in_mux-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_side_effects_in_mux-bmv2-frontend.p4 index 2990d7d194..8d81f7f85f 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_side_effects_in_mux-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_side_effects_in_mux-bmv2-frontend.p4 @@ -34,22 +34,16 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp_0") bit<16> tmp_0; @name("ingress.tmp_1") bit<16> tmp_1; @name("ingress.hPSe_0") bit<8> hPSe; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<16> retval; @name("ingress.hPSe_1") bit<8> hPSe_2; - @name("ingress.hasReturned") bool hasReturned_1; @name("ingress.retval") bit<16> retval_1; apply { if (h.eth_hdr.src_addr == 48w5) { - hasReturned = false; - hasReturned = true; retval = 16w2; h.h.a = hPSe; tmp_0 = retval; tmp = tmp_0; } else { - hasReturned_1 = false; - hasReturned_1 = true; retval_1 = 16w2; h.h.b = hPSe_2; tmp_1 = retval_1; diff --git a/testdata/p4_16_samples_outputs/gauntlet_side_effects_in_mux-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/gauntlet_side_effects_in_mux-bmv2.p4-stderr index 76b335e1a6..86578b8912 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_side_effects_in_mux-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/gauntlet_side_effects_in_mux-bmv2.p4-stderr @@ -4,3 +4,7 @@ bit<16> reset(out bit<8> hPSe) { gauntlet_side_effects_in_mux-bmv2.p4(22) bit<16> reset(out bit<8> hPSe) { ^^^^^ +[--Wwarn=uninitialized_use] warning: hPSe_0 may be uninitialized +[--Wwarn=uninitialized_use] warning: hPSe_1 may be uninitialized +[--Wwarn=uninitialized_use] warning: hPSe_0 may be uninitialized +[--Wwarn=uninitialized_use] warning: hPSe_1 may be uninitialized diff --git a/testdata/p4_16_samples_outputs/gauntlet_switch_nested_table_apply-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/gauntlet_switch_nested_table_apply-bmv2.p4-stderr index 1f3b8db6f3..cc0c20cb60 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_switch_nested_table_apply-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/gauntlet_switch_nested_table_apply-bmv2.p4-stderr @@ -10,3 +10,6 @@ gauntlet_switch_nested_table_apply-bmv2.p4(34): [--Wwarn=mismatch] warning: 128w gauntlet_switch_nested_table_apply-bmv2.p4(42): [--Wwarn=mismatch] warning: 48w1: Constant key field 48w1: exact @name("qkgOtm") ; ^^^^ +gauntlet_switch_nested_table_apply-bmv2.p4(27): [--Wwarn=uninitialized_use] warning: tmp may not be completely initialized + action set_valid_action(out Headers tmp) { + ^^^ diff --git a/testdata/p4_16_samples_outputs/gauntlet_switch_shadowing-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_switch_shadowing-bmv2-frontend.p4 index 8d393c1cac..0d53036693 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_switch_shadowing-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_switch_shadowing-bmv2-frontend.p4 @@ -24,8 +24,6 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.val_0") bit<32> val; - @name("ingress.hasReturned") bool hasReturned; - @name("ingress.retval") bit<2> retval; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @name("ingress.action_1") action action_1() { @@ -55,9 +53,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { default: { } } - hasReturned = false; - hasReturned = true; - retval = 2w2; sm.instance_type = val; } } diff --git a/testdata/p4_16_samples_outputs/gauntlet_switch_shadowing-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/gauntlet_switch_shadowing-bmv2.p4-stderr index 5fe2e43d90..8b9e1a2e61 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_switch_shadowing-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/gauntlet_switch_shadowing-bmv2.p4-stderr @@ -4,3 +4,5 @@ bit<2> set_undefined(out bit<32> val) { gauntlet_switch_shadowing-bmv2.p4(16) bit<2> set_undefined(out bit<32> val) { ^^^^^^^^^^^^^ +[--Wwarn=uninitialized_use] warning: val_0 may be uninitialized +[--Wwarn=uninitialized_use] warning: val_0 may be uninitialized diff --git a/testdata/p4_16_samples_outputs/gauntlet_uninitialized_bool_struct-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/gauntlet_uninitialized_bool_struct-bmv2.p4-stderr index 4b469b1ef3..00a6ac691b 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_uninitialized_bool_struct-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/gauntlet_uninitialized_bool_struct-bmv2.p4-stderr @@ -16,3 +16,9 @@ gauntlet_uninitialized_bool_struct-bmv2.p4(33): [--Wwarn=uninitialized_out_param gauntlet_uninitialized_bool_struct-bmv2.p4(33) action dummy_action(out bit<16> dummy_bit, out bool_struct dummy_struct) { ^^^^^^^^^^^^ +gauntlet_uninitialized_bool_struct-bmv2.p4(33): [--Wwarn=uninitialized_use] warning: dummy_bit may be uninitialized + action dummy_action(out bit<16> dummy_bit, out bool_struct dummy_struct) { + ^^^^^^^^^ +gauntlet_uninitialized_bool_struct-bmv2.p4(33): [--Wwarn=uninitialized_use] warning: dummy_struct may not be completely initialized + action dummy_action(out bit<16> dummy_bit, out bool_struct dummy_struct) { + ^^^^^^^^^^^^ diff --git a/testdata/p4_16_samples_outputs/global_action_after_exit-frontend.p4 b/testdata/p4_16_samples_outputs/global_action_after_exit-frontend.p4 index ad7f85064d..2bceb7ecf9 100644 --- a/testdata/p4_16_samples_outputs/global_action_after_exit-frontend.p4 +++ b/testdata/p4_16_samples_outputs/global_action_after_exit-frontend.p4 @@ -23,11 +23,7 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.val") ethernet_t val_0; @name(".do_action") action do_action_0() { - val_0 = h.eth_hdr; - val_0.eth_type = 16w0xdead; - h.eth_hdr = val_0; } apply { exit; diff --git a/testdata/p4_16_samples_outputs/global_action_after_exit-midend.p4 b/testdata/p4_16_samples_outputs/global_action_after_exit-midend.p4 index d275d8f59e..b2516f6ab0 100644 --- a/testdata/p4_16_samples_outputs/global_action_after_exit-midend.p4 +++ b/testdata/p4_16_samples_outputs/global_action_after_exit-midend.p4 @@ -23,6 +23,8 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { + @name(".do_action") action do_action_0() { + } apply { } } @@ -49,4 +51,3 @@ control deparser(packet_out pkt, in Headers h) { } V1Switch(p(), vrfy(), ingress(), egress(), update(), deparser()) main; - diff --git a/testdata/p4_16_samples_outputs/inline-control1-frontend.p4 b/testdata/p4_16_samples_outputs/inline-control1-frontend.p4 index ad739dfc06..cbc80e3013 100644 --- a/testdata/p4_16_samples_outputs/inline-control1-frontend.p4 +++ b/testdata/p4_16_samples_outputs/inline-control1-frontend.p4 @@ -4,14 +4,12 @@ extern Y { } control d(out bit<32> x) { - @name("d.y") bit<32> y_0; @name("d.x_0") bit<32> x_0; @name("d.cinst.y") Y(32w16) cinst_y; apply { x_0 = cinst_y.get(); x = x_0; - x_0 = cinst_y.get(); - y_0 = x_0; + cinst_y.get(); } } diff --git a/testdata/p4_16_samples_outputs/inline-control1-midend.p4 b/testdata/p4_16_samples_outputs/inline-control1-midend.p4 index af9ca7ddf5..f0f8b71501 100644 --- a/testdata/p4_16_samples_outputs/inline-control1-midend.p4 +++ b/testdata/p4_16_samples_outputs/inline-control1-midend.p4 @@ -9,7 +9,7 @@ control d(out bit<32> x) { @hidden action inlinecontrol1l24() { x_0 = cinst_y.get(); x = x_0; - x_0 = cinst_y.get(); + cinst_y.get(); } @hidden table tbl_inlinecontrol1l24 { actions = { diff --git a/testdata/p4_16_samples_outputs/inline-function-frontend.p4 b/testdata/p4_16_samples_outputs/inline-function-frontend.p4 index ffa95c5d4b..70529af9c8 100644 --- a/testdata/p4_16_samples_outputs/inline-function-frontend.p4 +++ b/testdata/p4_16_samples_outputs/inline-function-frontend.p4 @@ -1,34 +1,28 @@ control c(inout bit<32> x) { @name("c.a_1") bit<32> a; @name("c.b_1") bit<32> b; - @name("c.hasReturned_0") bool hasReturned; @name("c.retval_0") bit<32> retval; @name("c.tmp_0") bit<32> tmp; @name("c.tmp_1") bit<32> tmp_0; @name("c.tmp_2") bit<32> tmp_1; @name("c.a_0") bit<32> a_2; @name("c.b_0") bit<32> b_2; - @name("c.hasReturned") bool hasReturned_0; @name("c.retval") bit<32> retval_0; @name("c.tmp") bit<32> tmp_2; apply { a = x; b = x; - hasReturned = false; tmp = a; a_2 = a; b_2 = b; - hasReturned_0 = false; if (a_2 > b_2) { tmp_2 = b_2; } else { tmp_2 = a_2; } - hasReturned_0 = true; retval_0 = tmp_2; tmp_0 = retval_0; tmp_1 = tmp + tmp_0; - hasReturned = true; retval = tmp_1; x = retval; } diff --git a/testdata/p4_16_samples_outputs/inline-switch-frontend.p4 b/testdata/p4_16_samples_outputs/inline-switch-frontend.p4 index c2505c620f..8e52117f73 100644 --- a/testdata/p4_16_samples_outputs/inline-switch-frontend.p4 +++ b/testdata/p4_16_samples_outputs/inline-switch-frontend.p4 @@ -1,5 +1,4 @@ control d(out bit<32> x) { - @name("d.cinst.hasReturned") bool cinst_hasReturned; @name("d.cinst.a1") action cinst_a1_0() { } @name("d.cinst.a2") action cinst_a2_0() { @@ -12,14 +11,11 @@ control d(out bit<32> x) { default_action = cinst_a1_0(); } apply { - cinst_hasReturned = false; switch (cinst_t.apply().action_run) { cinst_a1_0: cinst_a2_0: { - cinst_hasReturned = true; } default: { - cinst_hasReturned = true; } } } diff --git a/testdata/p4_16_samples_outputs/inline-switch.p4-stderr b/testdata/p4_16_samples_outputs/inline-switch.p4-stderr index beab8bd5fe..99c106d00d 100644 --- a/testdata/p4_16_samples_outputs/inline-switch.p4-stderr +++ b/testdata/p4_16_samples_outputs/inline-switch.p4-stderr @@ -4,3 +4,9 @@ control c(out bit<32> x) { inline-switch.p4(17) control c(out bit<32> x) { ^ +inline-switch.p4(36): [--Wwarn=uninitialized_out_param] warning: out parameter 'x' may be uninitialized when 'd' terminates +control d(out bit<32> x) { + ^ +inline-switch.p4(36) +control d(out bit<32> x) { + ^ diff --git a/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-first.p4 b/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-first.p4 index 6db642c62d..7036e91457 100644 --- a/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-first.p4 +++ b/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-first.p4 @@ -86,3 +86,4 @@ control ComputeChecksumI(inout H hdr, inout M meta) { } V1Switch(ParserI(), VerifyChecksumI(), IngressI(), EgressI(), ComputeChecksumI(), DeparserI()) main; + diff --git a/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-frontend.p4 b/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-frontend.p4 index f87c7c7861..580e201dc0 100644 --- a/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-frontend.p4 @@ -95,3 +95,4 @@ control ComputeChecksumI(inout H hdr, inout M meta) { } V1Switch(ParserI(), VerifyChecksumI(), IngressI(), EgressI(), ComputeChecksumI(), DeparserI()) main; + diff --git a/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-midend.p4 b/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-midend.p4 index 726e666e3a..811cdcdf5d 100644 --- a/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-midend.p4 +++ b/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-midend.p4 @@ -225,3 +225,4 @@ control ComputeChecksumI(inout H hdr, inout M meta) { } V1Switch(ParserI(), VerifyChecksumI(), IngressI(), EgressI(), ComputeChecksumI(), DeparserI()) main; + diff --git a/testdata/p4_16_samples_outputs/invalid-hdr-warnings4-frontend.p4 b/testdata/p4_16_samples_outputs/invalid-hdr-warnings4-frontend.p4 index 7fbd5b59d6..568601a7d0 100644 --- a/testdata/p4_16_samples_outputs/invalid-hdr-warnings4-frontend.p4 +++ b/testdata/p4_16_samples_outputs/invalid-hdr-warnings4-frontend.p4 @@ -39,8 +39,6 @@ control IngressI(inout H hdr, inout M meta, inout standard_metadata_t smeta) { @name("IngressI.h") H h_0; @name("IngressI.h_copy") H h_copy_0; @name("IngressI.h_copy2") H h_copy2_0; - @name("IngressI.i") bit<1> i_0; - @name("IngressI.tmp") bit<1> tmp; @name("IngressI.hd") Header hd_0; @name("IngressI.hd") Header hd_1; @name("IngressI.hd") Header hd_8; @@ -48,42 +46,22 @@ control IngressI(inout H hdr, inout M meta, inout standard_metadata_t smeta) { @name("IngressI.hd") Header hd_10; @name("IngressI.hd") Header hd_11; @name("IngressI.hd") Header hd_12; - @name("IngressI.stack") Header[2] stack_0; - @name("IngressI.stack") Header[2] stack_2; @name("IngressI.validateHeader") action validateHeader() { - hd_10 = h_0.h1[0]; hd_10.setValid(); - h_0.h1[0] = hd_10; } @name("IngressI.validateHeader") action validateHeader_1() { - hd_11 = h_0.h2[tmp]; hd_11.setValid(); - h_0.h2[tmp] = hd_11; } @name("IngressI.invalidateHeader") action invalidateHeader() { - hd_12 = h_0.h2[0]; hd_12.setInvalid(); - h_0.h2[0] = hd_12; } @name("IngressI.invalidateStack") action invalidateStack() { - stack_0 = h_0.h1; - hd_0 = stack_0[0]; hd_0.setInvalid(); - stack_0[0] = hd_0; - hd_1 = stack_0[1]; hd_1.setInvalid(); - stack_0[1] = hd_1; - h_0.h1 = stack_0; } @name("IngressI.invalidateStack") action invalidateStack_1() { - stack_2 = h_copy_0.h1; - hd_8 = stack_2[0]; hd_8.setInvalid(); - stack_2[0] = hd_8; - hd_9 = stack_2[1]; hd_9.setInvalid(); - stack_2[1] = hd_9; - h_copy_0.h1 = stack_2; } apply { h_0.h1[0].setInvalid(); @@ -99,18 +77,7 @@ control IngressI(inout H hdr, inout M meta, inout standard_metadata_t smeta) { h_copy2_0.h2[0].setInvalid(); h_copy2_0.h2[1].setInvalid(); validateHeader(); - h_0.h1[0].data = 32w1; - h_0.h1[1] = h_0.h1[0]; - h_0.h1[1].data = 32w1; - h_0.h2 = h_0.h1; - h_0.h2[0].data = 32w1; - h_0.h2[1].data = 32w1; - h_copy_0 = h_0; - h_copy_0.h1[0].data = 32w1; - h_copy_0.h1[1].data = 32w1; invalidateHeader(); - i_0 = 1w1; - tmp = i_0; validateHeader_1(); invalidateStack(); invalidateStack_1(); diff --git a/testdata/p4_16_samples_outputs/invalid-hdr-warnings4-midend.p4 b/testdata/p4_16_samples_outputs/invalid-hdr-warnings4-midend.p4 index c03417ad39..ac12ee7c44 100644 --- a/testdata/p4_16_samples_outputs/invalid-hdr-warnings4-midend.p4 +++ b/testdata/p4_16_samples_outputs/invalid-hdr-warnings4-midend.p4 @@ -39,7 +39,6 @@ control IngressI(inout H hdr, inout M meta, inout standard_metadata_t smeta) { Header[2] h_copy_0_h2; Header[2] h_copy2_0_h1; Header[2] h_copy2_0_h2; - @name("IngressI.tmp") bit<1> tmp; @name("IngressI.hd") Header hd_0; @name("IngressI.hd") Header hd_1; @name("IngressI.hd") Header hd_8; @@ -47,46 +46,22 @@ control IngressI(inout H hdr, inout M meta, inout standard_metadata_t smeta) { @name("IngressI.hd") Header hd_10; @name("IngressI.hd") Header hd_11; @name("IngressI.hd") Header hd_12; - @name("IngressI.stack") Header[2] stack_0; - @name("IngressI.stack") Header[2] stack_2; @name("IngressI.validateHeader") action validateHeader() { - hd_10 = h_0_h1[0]; hd_10.setValid(); - h_0_h1[0] = hd_10; } @name("IngressI.validateHeader") action validateHeader_1() { - hd_11 = h_0_h2[1w1]; hd_11.setValid(); - if (tmp == 1w0) { - h_0_h2[1w0] = hd_11; - } else if (tmp == 1w1) { - h_0_h2[1w1] = hd_11; - } } @name("IngressI.invalidateHeader") action invalidateHeader() { - hd_12 = h_0_h2[0]; hd_12.setInvalid(); - h_0_h2[0] = hd_12; } @name("IngressI.invalidateStack") action invalidateStack() { - stack_0 = h_0_h1; - hd_0 = stack_0[0]; hd_0.setInvalid(); - stack_0[0] = hd_0; - hd_1 = stack_0[1]; hd_1.setInvalid(); - stack_0[1] = hd_1; - h_0_h1 = stack_0; } @name("IngressI.invalidateStack") action invalidateStack_1() { - stack_2 = h_copy_0_h1; - hd_8 = stack_2[0]; hd_8.setInvalid(); - stack_2[0] = hd_8; - hd_9 = stack_2[1]; hd_9.setInvalid(); - stack_2[1] = hd_9; - h_copy_0_h1 = stack_2; } @hidden action invalidhdrwarnings4l45() { h_0_h1[0].setInvalid(); @@ -102,21 +77,6 @@ control IngressI(inout H hdr, inout M meta, inout standard_metadata_t smeta) { h_copy2_0_h2[0].setInvalid(); h_copy2_0_h2[1].setInvalid(); } - @hidden action invalidhdrwarnings4l64() { - h_0_h1[0].data = 32w1; - h_0_h1[1] = h_0_h1[0]; - h_0_h1[1].data = 32w1; - h_0_h2 = h_0_h1; - h_0_h2[0].data = 32w1; - h_0_h2[1].data = 32w1; - h_copy_0_h1 = h_0_h1; - h_copy_0_h2 = h_0_h2; - h_copy_0_h1[0].data = 32w1; - h_copy_0_h1[1].data = 32w1; - } - @hidden action invalidhdrwarnings4l93() { - tmp = 1w1; - } @hidden action invalidhdrwarnings4l108() { h_0_h1[1].setValid(); } @@ -132,24 +92,12 @@ control IngressI(inout H hdr, inout M meta, inout standard_metadata_t smeta) { } const default_action = validateHeader(); } - @hidden table tbl_invalidhdrwarnings4l64 { - actions = { - invalidhdrwarnings4l64(); - } - const default_action = invalidhdrwarnings4l64(); - } @hidden table tbl_invalidateHeader { actions = { invalidateHeader(); } const default_action = invalidateHeader(); } - @hidden table tbl_invalidhdrwarnings4l93 { - actions = { - invalidhdrwarnings4l93(); - } - const default_action = invalidhdrwarnings4l93(); - } @hidden table tbl_validateHeader_0 { actions = { validateHeader_1(); @@ -177,9 +125,7 @@ control IngressI(inout H hdr, inout M meta, inout standard_metadata_t smeta) { apply { tbl_invalidhdrwarnings4l45.apply(); tbl_validateHeader.apply(); - tbl_invalidhdrwarnings4l64.apply(); tbl_invalidateHeader.apply(); - tbl_invalidhdrwarnings4l93.apply(); tbl_validateHeader_0.apply(); tbl_invalidateStack.apply(); tbl_invalidateStack_0.apply(); diff --git a/testdata/p4_16_samples_outputs/invalid-hdr-warnings8-frontend.p4 b/testdata/p4_16_samples_outputs/invalid-hdr-warnings8-frontend.p4 index 2e6a4e10b3..6bc390688c 100644 --- a/testdata/p4_16_samples_outputs/invalid-hdr-warnings8-frontend.p4 +++ b/testdata/p4_16_samples_outputs/invalid-hdr-warnings8-frontend.p4 @@ -32,12 +32,6 @@ control c(inout bit<32> x) { @name("c.us1") U[2] us1_6; @name("c.result") bit<32> result_0; @name("c.inout_action2") action inout_action2() { - u1_5 = u_0; - hs1_5 = hs_0; - us1_5 = us_0; - u1_2 = u1_5; - hs1_2 = hs1_5; - us1_2 = us1_5; u1_3.h1.a = 32w1; u1_3.h2.a = 32w1; hs1_3[0].a = 32w1; diff --git a/testdata/p4_16_samples_outputs/invalid-hdr-warnings8-midend.p4 b/testdata/p4_16_samples_outputs/invalid-hdr-warnings8-midend.p4 index 267381c6fa..c98bcf7e89 100644 --- a/testdata/p4_16_samples_outputs/invalid-hdr-warnings8-midend.p4 +++ b/testdata/p4_16_samples_outputs/invalid-hdr-warnings8-midend.p4 @@ -204,4 +204,3 @@ control c(inout bit<32> x) { } top(c()) main; - diff --git a/testdata/p4_16_samples_outputs/issue-3312-graph-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue-3312-graph-bmv2-frontend.p4 index 592bf6c5ac..6d8ae82a48 100644 --- a/testdata/p4_16_samples_outputs/issue-3312-graph-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue-3312-graph-bmv2-frontend.p4 @@ -45,8 +45,6 @@ control deparser(packet_out b, in Headers h) { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.add") action add() { - h.h.c = (bit<64>)(h.h.a + h.h.b); - sm.egress_spec = 9w0; } @name("ingress.add") action add_1() { h.h.c = (bit<64>)(h.h.a + h.h.b); diff --git a/testdata/p4_16_samples_outputs/issue-3312-graph-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue-3312-graph-bmv2-midend.p4 index 592bf6c5ac..6d8ae82a48 100644 --- a/testdata/p4_16_samples_outputs/issue-3312-graph-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue-3312-graph-bmv2-midend.p4 @@ -45,8 +45,6 @@ control deparser(packet_out b, in Headers h) { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.add") action add() { - h.h.c = (bit<64>)(h.h.a + h.h.b); - sm.egress_spec = 9w0; } @name("ingress.add") action add_1() { h.h.c = (bit<64>)(h.h.a + h.h.b); diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2-first.p4 index 937ff87042..3761a70f25 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2-first.p4 @@ -6,7 +6,7 @@ struct Headers { } struct Meta { - @field_list(0) + @field_list(0) bit<1> b; } @@ -44,3 +44,4 @@ control deparser(packet_out b, in Headers h) { } V1Switch(p(), vrfy(), ingress(), egress(), update(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 index 937ff87042..3761a70f25 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 @@ -6,7 +6,7 @@ struct Headers { } struct Meta { - @field_list(0) + @field_list(0) bit<1> b; } @@ -44,3 +44,4 @@ control deparser(packet_out b, in Headers h) { } V1Switch(p(), vrfy(), ingress(), egress(), update(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 index 6c9807e407..ff5ba9f3b2 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 @@ -6,7 +6,7 @@ struct Headers { } struct Meta { - @field_list(0) + @field_list(0) bit<1> b; } @@ -53,3 +53,4 @@ control deparser(packet_out b, in Headers h) { } V1Switch(p(), vrfy(), ingress(), egress(), update(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 index 2a703619e0..e404603371 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 @@ -6,7 +6,7 @@ struct Headers { } struct Meta { - @field_list(0) + @field_list(0) bit<1> b; } @@ -44,3 +44,4 @@ control deparser(packet_out b, in Headers h) { } V1Switch(p(), vrfy(), ingress(), egress(), update(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1334-frontend.p4 b/testdata/p4_16_samples_outputs/issue1334-frontend.p4 index 35d8dc1c52..36a892b0ba 100644 --- a/testdata/p4_16_samples_outputs/issue1334-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1334-frontend.p4 @@ -11,7 +11,6 @@ extern Overloaded { } control c() { - @name("c.z") bit<32> z_0; @name("c.o") Overloaded() o_0; apply { f(); @@ -24,7 +23,6 @@ control c() { o_0.f(b = 16w1); o_0.f(a = 32w1, b = 16w2); o_0.f(b = 16w2, a = 32w1); - z_0 = 32w4294967294; } } diff --git a/testdata/p4_16_samples_outputs/issue1452-1-frontend.p4 b/testdata/p4_16_samples_outputs/issue1452-1-frontend.p4 index 2a9452460c..cff54d6730 100644 --- a/testdata/p4_16_samples_outputs/issue1452-1-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1452-1-frontend.p4 @@ -1,9 +1,5 @@ control c() { - @name("c.x") bit<32> x_0; - @name("c.arg") bit<32> arg_0; @name("c.b") action b() { - arg_0 = 32w2; - x_0 = arg_0; } apply { b(); diff --git a/testdata/p4_16_samples_outputs/issue1452-frontend.p4 b/testdata/p4_16_samples_outputs/issue1452-frontend.p4 index 755d88dfd3..5f96637cfe 100644 --- a/testdata/p4_16_samples_outputs/issue1452-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1452-frontend.p4 @@ -1,13 +1,5 @@ control c() { - @name("c.x") bit<32> x_0; - @name("c.hasReturned") bool hasReturned; - @name("c.arg") bit<32> arg_0; @name("c.a") action a() { - arg_0 = x_0; - hasReturned = false; - arg_0 = 32w1; - hasReturned = true; - x_0 = arg_0; } apply { a(); diff --git a/testdata/p4_16_samples_outputs/issue1466-frontend.p4 b/testdata/p4_16_samples_outputs/issue1466-frontend.p4 index e59123ee43..d96f47867c 100644 --- a/testdata/p4_16_samples_outputs/issue1466-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1466-frontend.p4 @@ -5,7 +5,6 @@ header hdr { control A(inout hdr _hdr) { apply { _hdr.g = 1w1; - _hdr.g = 1w1; } } diff --git a/testdata/p4_16_samples_outputs/issue1466-midend.p4 b/testdata/p4_16_samples_outputs/issue1466-midend.p4 index 477b3da4d2..6963ae8833 100644 --- a/testdata/p4_16_samples_outputs/issue1466-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1466-midend.p4 @@ -5,7 +5,6 @@ header hdr { control A(inout hdr _hdr) { @hidden action issue1466l7() { _hdr.g = 1w1; - _hdr.g = 1w1; } @hidden table tbl_issue1466l7 { actions = { diff --git a/testdata/p4_16_samples_outputs/issue1520-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1520-bmv2-frontend.p4 index a4a2bdc775..7f6522be6f 100644 --- a/testdata/p4_16_samples_outputs/issue1520-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1520-bmv2-frontend.p4 @@ -29,7 +29,6 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat @name("MyIngress.h.c1.r") register>(32w8) h_c1_r; @name("MyIngress.h.c2.r") register>(32w8) h_c2_r; apply { - h_c1_r.read(hdr.h.x, 32w0); h_c2_r.read(hdr.h.x, 32w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1520-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1520-bmv2-midend.p4 index c6088ea6a2..d4908759b4 100644 --- a/testdata/p4_16_samples_outputs/issue1520-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1520-bmv2-midend.p4 @@ -29,7 +29,6 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat @name("MyIngress.h.c1.r") register>(32w8) h_c1_r; @name("MyIngress.h.c2.r") register>(32w8) h_c2_r; @hidden action issue1520bmv2l33() { - h_c1_r.read(hdr.h.x, 32w0); h_c2_r.read(hdr.h.x, 32w0); } @hidden table tbl_issue1520bmv2l33 { diff --git a/testdata/p4_16_samples_outputs/issue1538-frontend.p4 b/testdata/p4_16_samples_outputs/issue1538-frontend.p4 index 2c6c512889..cafbe39043 100644 --- a/testdata/p4_16_samples_outputs/issue1538-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1538-frontend.p4 @@ -19,15 +19,11 @@ struct headers { parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @name("ParserImpl.tmp_port") bit<16> tmp_port_0; @name("ParserImpl.x_1") bit<16> x; - @name("ParserImpl.hasReturned") bool hasReturned; @name("ParserImpl.retval") bit<16> retval; @name("ParserImpl.x_2") bit<16> x_6; - @name("ParserImpl.hasReturned") bool hasReturned_0; @name("ParserImpl.retval") bit<16> retval_0; state start { x = (bit<16>)standard_metadata.ingress_port; - hasReturned = false; - hasReturned = true; retval = x + 16w1; tmp_port_0 = retval; transition start_0; @@ -35,8 +31,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout state start_0 { packet.extract(hdr.ethernet); x_6 = hdr.ethernet.etherType; - hasReturned_0 = false; - hasReturned_0 = true; retval_0 = x_6 + 16w1; hdr.ethernet.etherType = retval_0; meta.tmp_port = tmp_port_0; @@ -47,19 +41,15 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @name("ingress.smeta") standard_metadata_t smeta_0; @name("ingress.x_3") bit<16> x_7; - @name("ingress.hasReturned_0") bool hasReturned_3; @name("ingress.retval_0") bit<16> retval_3; @name("ingress.tmp") bit<16> tmp; @name("ingress.tmp_0") bit<16> tmp_0; @name("ingress.tmp_1") bit<16> tmp_1; @name("ingress.x_0") bit<16> x_8; - @name("ingress.hasReturned") bool hasReturned_4; @name("ingress.retval") bit<16> retval_4; @name("ingress.x_4") bit<16> x_9; - @name("ingress.hasReturned") bool hasReturned_5; @name("ingress.retval") bit<16> retval_5; @name("ingress.x_5") bit<16> x_10; - @name("ingress.hasReturned") bool hasReturned_6; @name("ingress.retval") bit<16> retval_6; @name(".my_drop") action my_drop_0() { smeta_0 = standard_metadata; @@ -82,25 +72,17 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ apply { mac_da_0.apply(); x_7 = hdr.ethernet.srcAddr[15:0]; - hasReturned_3 = false; tmp = x_7; x_8 = x_7; - hasReturned_4 = false; - hasReturned_4 = true; retval_4 = x_8 + 16w1; tmp_0 = retval_4; tmp_1 = tmp + tmp_0; - hasReturned_3 = true; retval_3 = tmp_1; hdr.ethernet.srcAddr[15:0] = retval_3; x_9 = hdr.ethernet.srcAddr[15:0]; - hasReturned_5 = false; - hasReturned_5 = true; retval_5 = x_9 + 16w1; hdr.ethernet.srcAddr[15:0] = retval_5; x_10 = hdr.ethernet.etherType; - hasReturned_6 = false; - hasReturned_6 = true; retval_6 = x_10 + 16w1; hdr.ethernet.etherType = retval_6; } diff --git a/testdata/p4_16_samples_outputs/issue1544-1-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1544-1-bmv2-frontend.p4 index 75132c8c46..247b317cfe 100644 --- a/testdata/p4_16_samples_outputs/issue1544-1-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1544-1-bmv2-frontend.p4 @@ -25,7 +25,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @name("ingress.smeta") standard_metadata_t smeta_0; @name("ingress.x_0") bit<16> x; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<16> retval; @name("ingress.tmp") bit<16> tmp_0; @name(".my_drop") action my_drop_0() { @@ -49,13 +48,11 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ apply { mac_da_0.apply(); x = hdr.ethernet.srcAddr[15:0]; - hasReturned = false; if (x > 16w5) { tmp_0 = x + 16w65535; } else { tmp_0 = x; } - hasReturned = true; retval = tmp_0; hdr.ethernet.srcAddr[15:0] = retval; } diff --git a/testdata/p4_16_samples_outputs/issue1544-2-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1544-2-bmv2-frontend.p4 index 675539c237..0740120c5d 100644 --- a/testdata/p4_16_samples_outputs/issue1544-2-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1544-2-bmv2-frontend.p4 @@ -25,7 +25,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @name("ingress.smeta") standard_metadata_t smeta_0; @name("ingress.x_0") bit<16> x; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<16> retval; @name("ingress.tmp") bit<16> tmp_0; @name(".my_drop") action my_drop_0() { @@ -49,12 +48,10 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ apply { mac_da_0.apply(); x = hdr.ethernet.srcAddr[15:0]; - hasReturned = false; tmp_0 = x; if (x > 16w5) { tmp_0 = x + 16w65535; } - hasReturned = true; retval = tmp_0; hdr.ethernet.srcAddr[15:0] = retval; } diff --git a/testdata/p4_16_samples_outputs/issue1544-2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1544-2-frontend.p4 index 348c2d576f..75503d55e7 100644 --- a/testdata/p4_16_samples_outputs/issue1544-2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1544-2-frontend.p4 @@ -3,51 +3,42 @@ control c(inout bit<32> x) { @name("c.tmp_1") bit<32> tmp_0; @name("c.a_0") bit<32> a; @name("c.b_0") bit<32> b; - @name("c.hasReturned") bool hasReturned; @name("c.retval") bit<32> retval; @name("c.tmp") bit<32> tmp_1; @name("c.a_1") bit<32> a_3; @name("c.b_1") bit<32> b_3; - @name("c.hasReturned") bool hasReturned_1; @name("c.retval") bit<32> retval_1; @name("c.tmp") bit<32> tmp_5; @name("c.a_2") bit<32> a_4; @name("c.b_2") bit<32> b_4; - @name("c.hasReturned") bool hasReturned_2; @name("c.retval") bit<32> retval_2; @name("c.tmp") bit<32> tmp_6; apply { a = x; b = x + 32w1; - hasReturned = false; if (a > b) { tmp_1 = b; } else { tmp_1 = a; } - hasReturned = true; retval = tmp_1; tmp = retval; a_3 = x; b_3 = x + 32w4294967295; - hasReturned_1 = false; if (a_3 > b_3) { tmp_5 = b_3; } else { tmp_5 = a_3; } - hasReturned_1 = true; retval_1 = tmp_5; tmp_0 = retval_1; a_4 = tmp; b_4 = tmp_0; - hasReturned_2 = false; if (a_4 > b_4) { tmp_6 = b_4; } else { tmp_6 = a_4; } - hasReturned_2 = true; retval_2 = tmp_6; x = retval_2; } diff --git a/testdata/p4_16_samples_outputs/issue1544-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1544-bmv2-frontend.p4 index 592511731d..926e460820 100644 --- a/testdata/p4_16_samples_outputs/issue1544-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1544-bmv2-frontend.p4 @@ -25,7 +25,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @name("ingress.smeta") standard_metadata_t smeta_0; @name("ingress.x_0") bit<16> x; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<16> retval; @name(".my_drop") action my_drop_0() { smeta_0 = standard_metadata; @@ -48,12 +47,9 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ apply { mac_da_0.apply(); x = hdr.ethernet.srcAddr[15:0]; - hasReturned = false; if (x > 16w5) { - hasReturned = true; retval = x + 16w65535; } else { - hasReturned = true; retval = x; } hdr.ethernet.srcAddr[15:0] = retval; diff --git a/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 index 00661351a5..73f4e203a6 100644 --- a/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 @@ -21,7 +21,7 @@ struct parsed_packet_t { struct local_metadata_t { short s; - @field_list(0) + @field_list(0) row_t row; } @@ -63,3 +63,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 index 00661351a5..73f4e203a6 100644 --- a/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 @@ -21,7 +21,7 @@ struct parsed_packet_t { struct local_metadata_t { short s; - @field_list(0) + @field_list(0) row_t row; } @@ -63,3 +63,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 index e0282a4339..42babd22d2 100644 --- a/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 @@ -21,13 +21,13 @@ struct parsed_packet_t { struct local_metadata_t { short _s0; - @field_list(0) + @field_list(0) bit<1> _row_alt0_valid1; - @field_list(0) + @field_list(0) bit<7> _row_alt0_port2; - @field_list(0) + @field_list(0) bit<1> _row_alt1_valid3; - @field_list(0) + @field_list(0) bit<7> _row_alt1_port4; } @@ -79,3 +79,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 index fbdffd0e29..7e3a687674 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 @@ -51,3 +51,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 index f9e1c2c61d..c3c22fb482 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 @@ -51,3 +51,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 index 86b5cf3134..78c744a098 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 @@ -60,3 +60,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 index a263d52d61..26cdca67f3 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 @@ -51,3 +51,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-first.p4 index a1bebbde92..95fbd25c30 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-first.p4 @@ -31,7 +31,7 @@ header bitvec_hdr { } struct local_metadata_t { - @field_list(0) + @field_list(0) row_t row0; row_t row1; bitvec_hdr bvh0; @@ -101,3 +101,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-frontend.p4 index 62b9ecb0c9..6700a675ac 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-frontend.p4 @@ -31,7 +31,7 @@ header bitvec_hdr { } struct local_metadata_t { - @field_list(0) + @field_list(0) row_t row0; row_t row1; bitvec_hdr bvh0; @@ -103,3 +103,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-midend.p4 index 8195e38f4e..48be27437f 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-midend.p4 @@ -32,29 +32,29 @@ header bitvec_hdr { } struct local_metadata_t { - @field_list(0) + @field_list(0) bit<1> _row0_alt0_valid0; - @field_list(0) + @field_list(0) bit<7> _row0_alt0_port1; - @field_list(0) + @field_list(0) int<8> _row0_alt0_hashRes2; - @field_list(0) + @field_list(0) bool _row0_alt0_useHash3; - @field_list(0) + @field_list(0) bit<16> _row0_alt0_type4; - @field_list(0) + @field_list(0) bit<7> _row0_alt0_pad5; - @field_list(0) + @field_list(0) bit<1> _row0_alt1_valid6; - @field_list(0) + @field_list(0) bit<7> _row0_alt1_port7; - @field_list(0) + @field_list(0) int<8> _row0_alt1_hashRes8; - @field_list(0) + @field_list(0) bool _row0_alt1_useHash9; - @field_list(0) + @field_list(0) bit<16> _row0_alt1_type10; - @field_list(0) + @field_list(0) bit<7> _row0_alt1_pad11; bit<1> _row1_alt0_valid12; bit<7> _row1_alt0_port13; @@ -155,3 +155,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 index 4910a097ec..14918539bf 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 @@ -31,7 +31,7 @@ header bitvec_hdr { } struct local_metadata_t { - @field_list(0) + @field_list(0) row_t row0; row_t row1; bitvec_hdr bvh0; @@ -99,3 +99,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1717-frontend.p4 b/testdata/p4_16_samples_outputs/issue1717-frontend.p4 index 80aeb4fa5d..0e9f9e24b9 100644 --- a/testdata/p4_16_samples_outputs/issue1717-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1717-frontend.p4 @@ -40,7 +40,6 @@ control c(out bit<32> size) { @name("c.h2") H1 h2_2; @name("c.h1_0") H h1_3; @name("c.h2_0") H1 h2_3; - @name("c.hasReturned") bool hasReturned; @name("c.retval") bit<32> retval; @name("c.b1") bool b1_0; apply { @@ -48,9 +47,7 @@ control c(out bit<32> size) { h2_2.setInvalid(); h1_3 = h1_2; h2_3 = h2_2; - hasReturned = false; b1_0 = h2_3.minSizeInBits == 8w32; - hasReturned = true; retval = h1_3.isValid + (b1_0 ? 32w117 : 32w162); size = retval; } diff --git a/testdata/p4_16_samples_outputs/issue1717.p4-stderr b/testdata/p4_16_samples_outputs/issue1717.p4-stderr index 2885a952b0..05aa0fdfb9 100644 --- a/testdata/p4_16_samples_outputs/issue1717.p4-stderr +++ b/testdata/p4_16_samples_outputs/issue1717.p4-stderr @@ -4,3 +4,7 @@ issue1717.p4(52): [--Wwarn=uninitialized_use] warning: h1 may not be completely issue1717.p4(52): [--Wwarn=uninitialized_use] warning: h2 may not be completely initialized size = v(h1, h2); ^^ +[--Wwarn=invalid_header] warning: accessing a field of an invalid header h2_0 +[--Wwarn=invalid_header] warning: accessing a field of an invalid header h1_0 +[--Wwarn=invalid_header] warning: accessing a field of an invalid header h2_0 +[--Wwarn=invalid_header] warning: accessing a field of an invalid header h1_0 diff --git a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-first.p4 index f36ae63ac2..188336e7e7 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-first.p4 @@ -116,15 +116,15 @@ struct headers { } struct metadata { - @field_list(0) + @field_list(0) port_t ingress_port; - @field_list(0) + @field_list(0) task_t task; - @field_list(0) + @field_list(0) bit<16> tcp_length; - @field_list(0) + @field_list(0) bit<32> cast_length; - @field_list(0) + @field_list(0) bit<1> do_cksum; } @@ -356,3 +356,4 @@ control MyEgress(inout headers hdr, inout metadata meta, inout standard_metadata } V1Switch(MyParser(), MyVerifyChecksum(), MyIngress(), MyEgress(), MyComputeChecksum(), MyDeparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-frontend.p4 index cf8e9ba097..8bc4de20f9 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-frontend.p4 @@ -98,15 +98,15 @@ struct headers { } struct metadata { - @field_list(0) + @field_list(0) port_t ingress_port; - @field_list(0) + @field_list(0) task_t task; - @field_list(0) + @field_list(0) bit<16> tcp_length; - @field_list(0) + @field_list(0) bit<32> cast_length; - @field_list(0) + @field_list(0) bit<1> do_cksum; } @@ -287,3 +287,4 @@ control MyEgress(inout headers hdr, inout metadata meta, inout standard_metadata } V1Switch(MyParser(), MyVerifyChecksum(), MyIngress(), MyEgress(), MyComputeChecksum(), MyDeparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-midend.p4 index c77ffd3881..cda22a6459 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-midend.p4 @@ -93,15 +93,15 @@ struct headers { } struct metadata { - @field_list(0) - bit<9> ingress_port; - @field_list(0) - bit<16> task; - @field_list(0) + @field_list(0) + port_t ingress_port; + @field_list(0) + task_t task; + @field_list(0) bit<16> tcp_length; - @field_list(0) + @field_list(0) bit<32> cast_length; - @field_list(0) + @field_list(0) bit<1> do_cksum; } @@ -299,4 +299,3 @@ control MyEgress(inout headers hdr, inout metadata meta, inout standard_metadata } V1Switch(MyParser(), MyVerifyChecksum(), MyIngress(), MyEgress(), MyComputeChecksum(), MyDeparser()) main; - diff --git a/testdata/p4_16_samples_outputs/issue1781-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1781-bmv2-frontend.p4 index 1ab8d197cf..50cf862e01 100644 --- a/testdata/p4_16_samples_outputs/issue1781-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1781-bmv2-frontend.p4 @@ -15,23 +15,9 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout } control IngressImpl(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { - @name("IngressImpl.value") bit<32> value_1; - @name("IngressImpl.value") bit<32> value_3; - @name("IngressImpl.hasReturned") bool hasReturned; - @name("IngressImpl.retval") bit<32> retval; - @name("IngressImpl.hasReturned") bool hasReturned_1; - @name("IngressImpl.retval") bit<32> retval_1; @name("IngressImpl.update_value") action update_value() { - hasReturned = false; - hasReturned = true; - retval = 32w1; - value_3 = retval; - value_1 = value_3; } apply { - hasReturned_1 = false; - hasReturned_1 = true; - retval_1 = 32w1; update_value(); } } diff --git a/testdata/p4_16_samples_outputs/issue1879-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1879-bmv2-frontend.p4 index efbaf1b1db..c369b157cb 100644 --- a/testdata/p4_16_samples_outputs/issue1879-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1879-bmv2-frontend.p4 @@ -70,12 +70,9 @@ struct headers { parser PROTParser(packet_in packet, out headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @name("PROTParser.paddingLen") bit<9> paddingLen_0; - @name("PROTParser.currentISelected") bool currentISelected_0; @name("PROTParser.hdrLeft") bit<8> hdrLeft_0; - @name("PROTParser.currentISelected") bool currentISelected_1; @name("PROTParser.inf_0") prot_i_t inf_0; @name("PROTParser.meta_0") metadata meta_0; - @name("PROTParser.currentISelected_2") bool currentISelected_2; @name("PROTParser.currI_0") bit<8> currI_0; @name("PROTParser.subParser.currentISelected2") bool subParser_currentISelected2; state start { @@ -96,10 +93,8 @@ parser PROTParser(packet_in packet, out headers hdr, inout metadata meta, inout packet.extract(hdr.prot_host_addr_padding, (bit<32>)paddingLen_0); meta.addrLen = meta.addrLen + paddingLen_0; meta.currPos = (bit<8>)(9w3 + (meta.addrLen >> 6)); - currentISelected_0 = hdr.prot_common.curri == meta.currPos; inf_0.setInvalid(); meta_0 = meta; - currentISelected_2 = currentISelected_0; currI_0 = hdr.prot_common.curri; transition SubParser_start; } @@ -136,10 +131,8 @@ parser PROTParser(packet_in packet, out headers hdr, inout metadata meta, inout } } state parse_prot_inf_1 { - currentISelected_1 = meta.currPos == hdr.prot_common.curri; inf_0.setInvalid(); meta_0 = meta; - currentISelected_2 = currentISelected_1; currI_0 = hdr.prot_common.curri; transition SubParser_start_0; } diff --git a/testdata/p4_16_samples_outputs/issue1897-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/issue1897-bmv2.p4-stderr index e69de29bb2..bc6a65297d 100644 --- a/testdata/p4_16_samples_outputs/issue1897-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/issue1897-bmv2.p4-stderr @@ -0,0 +1,4 @@ +[--Wwarn=uninitialized_use] warning: addr_0 may not be completely initialized +[--Wwarn=uninitialized_use] warning: addr_0 may not be completely initialized +[--Wwarn=uninitialized_use] warning: addr_0 may not be completely initialized +[--Wwarn=uninitialized_use] warning: addr_0 may not be completely initialized diff --git a/testdata/p4_16_samples_outputs/issue1985-frontend.p4 b/testdata/p4_16_samples_outputs/issue1985-frontend.p4 index e68d8cf715..abf2fb9c77 100644 --- a/testdata/p4_16_samples_outputs/issue1985-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1985-frontend.p4 @@ -30,11 +30,9 @@ control c2(inout headers hdr, inout metadata meta, inout standard_metadata_t std } control c3(inout headers hdr, inout metadata meta, inout standard_metadata_t std_meta) { - @name("c3.b") bool b_0; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @name("c3.a") action a() { - b_0 = hdr.h.isValid() || true; hdr.h.x = 8w0; } @name("c3.t") table t_0 { diff --git a/testdata/p4_16_samples_outputs/issue2104-1-frontend.p4 b/testdata/p4_16_samples_outputs/issue2104-1-frontend.p4 index d3dbe89960..24bf5fafb0 100644 --- a/testdata/p4_16_samples_outputs/issue2104-1-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2104-1-frontend.p4 @@ -2,13 +2,8 @@ control c(inout bit<8> a) { @name("c.x_0") bit<8> x; - @name("c.hasReturned") bool hasReturned; - @name("c.retval") bit<8> retval; apply { x = a; - hasReturned = false; - hasReturned = true; - retval = x; a = x; } } diff --git a/testdata/p4_16_samples_outputs/issue2104-frontend.p4 b/testdata/p4_16_samples_outputs/issue2104-frontend.p4 index 707ad2edc9..db5e0d25e8 100644 --- a/testdata/p4_16_samples_outputs/issue2104-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2104-frontend.p4 @@ -3,10 +3,7 @@ #include control c() { - @name("c.hasReturned") bool hasReturned; @name("c.v") action v() { - hasReturned = false; - hasReturned = true; } apply { v(); diff --git a/testdata/p4_16_samples_outputs/issue2148-frontend.p4 b/testdata/p4_16_samples_outputs/issue2148-frontend.p4 index cce26d1b17..a47073f579 100644 --- a/testdata/p4_16_samples_outputs/issue2148-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2148-frontend.p4 @@ -14,28 +14,14 @@ struct Meta { } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.hasReturned") bool hasReturned; - @name("ingress.retval") bit<16> retval; @name("ingress.not_initialized") H not_initialized_0; - @name("ingress.new_val") bit<32> new_val_0; - @name("ingress.hasReturned") bool hasReturned_1; @name("ingress.retval") bit<16> retval_1; @name("ingress.not_initialized") H not_initialized_1; @name("ingress.new_val") bit<32> new_val_1; @name("ingress.do_thing_action") action do_thing_action() { - hasReturned = false; not_initialized_0.setInvalid(); - new_val_0 = 32w1; - if (not_initialized_0.a < 16w6) { - ; - } else { - new_val_0 = 32w232; - } - hasReturned = true; - retval = (bit<16>)new_val_0; } apply { - hasReturned_1 = false; not_initialized_1.setInvalid(); new_val_1 = 32w1; if (not_initialized_1.a < 16w6) { @@ -43,7 +29,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { } else { new_val_1 = 32w232; } - hasReturned_1 = true; retval_1 = (bit<16>)new_val_1; h.h.a = retval_1; do_thing_action(); diff --git a/testdata/p4_16_samples_outputs/issue2176-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue2176-bmv2-frontend.p4 index d8f0ffd852..788b5a359b 100644 --- a/testdata/p4_16_samples_outputs/issue2176-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2176-bmv2-frontend.p4 @@ -36,26 +36,13 @@ parser p(packet_in pkt, out Parsed_packet hdr, inout Metadata meta, inout standa } control ingress(inout Parsed_packet h, inout Metadata m, inout standard_metadata_t sm) { - @name("ingress.tmp") bit<8> tmp; - @name("ingress.tmp_0") bit<8> tmp_0; @name("ingress.tmp_1") bit<8> tmp_1; - @name("ingress.val_0") bit<8> val; - @name("ingress.val_1") bit<8> val_3; @name("ingress.val_2") bit<8> val_4; @name("ingress.do_action_2") action do_action_0() { - val = tmp; - val_3 = tmp_0; - val_4 = tmp_1; - val_3 = 8w2; val_4 = 8w0; - tmp = val; - tmp_0 = val_3; tmp_1 = val_4; } apply { - tmp = h.h.b; - tmp_0 = h.h.b; - tmp_1 = h.h.b; do_action_0(); h.h.b = tmp_1; if (h.h.b > 8w1) { diff --git a/testdata/p4_16_samples_outputs/issue2176-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue2176-bmv2-midend.p4 index 77fd1ee598..8e8841b375 100644 --- a/testdata/p4_16_samples_outputs/issue2176-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue2176-bmv2-midend.p4 @@ -41,32 +41,23 @@ control ingress(inout Parsed_packet h, inout Metadata m, inout standard_metadata @name("ingress.do_action_2") action do_action_0() { tmp_1 = 8w0; } - @hidden action act() { - tmp_1 = h.h.b; - } @hidden action issue2176bmv2l45() { h.h.a = 8w1; } - @hidden action act_0() { + @hidden action act() { h.h.b = tmp_1; } - @hidden table tbl_act { - actions = { - act(); - } - const default_action = act(); - } @hidden table tbl_do_action { actions = { do_action_0(); } const default_action = do_action_0(); } - @hidden table tbl_act_0 { + @hidden table tbl_act { actions = { - act_0(); + act(); } - const default_action = act_0(); + const default_action = act(); } @hidden table tbl_issue2176bmv2l45 { actions = { @@ -75,9 +66,8 @@ control ingress(inout Parsed_packet h, inout Metadata m, inout standard_metadata const default_action = issue2176bmv2l45(); } apply { - tbl_act.apply(); tbl_do_action.apply(); - tbl_act_0.apply(); + tbl_act.apply(); if (tmp_1 > 8w1) { tbl_issue2176bmv2l45.apply(); } diff --git a/testdata/p4_16_samples_outputs/issue2176-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/issue2176-bmv2.p4-stderr index 15b969ee94..fa41e6b0ff 100644 --- a/testdata/p4_16_samples_outputs/issue2176-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/issue2176-bmv2.p4-stderr @@ -6,13 +6,13 @@ issue2176-bmv2.p4(43): [--Wwarn=ordering] warning: h.h.b: 'out' argument has fie ^^^^^ issue2176-bmv2.p4(43) do_action_2(h.h.b, h.h.b, h.h.b); - ^^^^^ + ^^^^^ issue2176-bmv2.p4(43): [--Wwarn=ordering] warning: h.h.b: 'out' argument has fields in common with h.h.b do_action_2(h.h.b, h.h.b, h.h.b); ^^^^^ issue2176-bmv2.p4(43) do_action_2(h.h.b, h.h.b, h.h.b); - ^^^^^ + ^^^^^ issue2176-bmv2.p4(43): [--Wwarn=ordering] warning: h.h.b: 'out' argument has fields in common with h.h.b do_action_2(h.h.b, h.h.b, h.h.b); ^^^^^ diff --git a/testdata/p4_16_samples_outputs/issue2205-1-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue2205-1-bmv2-frontend.p4 index 8afb688886..b40e8c701b 100644 --- a/testdata/p4_16_samples_outputs/issue2205-1-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2205-1-bmv2-frontend.p4 @@ -27,14 +27,10 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp_0") bit<16> tmp_0; @name("ingress.tmp_1") bool tmp_1; @name("ingress.val_0") bit<16> val; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<16> retval; apply { tmp = h.eth_hdr.eth_type; - val = h.eth_hdr.eth_type; - hasReturned = false; val = 16w182; - hasReturned = true; retval = 16w2; h.eth_hdr.eth_type = val; tmp_0 = retval; diff --git a/testdata/p4_16_samples_outputs/issue2205-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue2205-bmv2-frontend.p4 index c162e76945..3ffb650fab 100644 --- a/testdata/p4_16_samples_outputs/issue2205-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2205-bmv2-frontend.p4 @@ -25,18 +25,11 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp") bit<8> tmp; @name("ingress.tmp_0") bit<8> tmp_0; @name("ingress.tmp_1") bit<8> tmp_1; - @name("ingress.some_input_0") bit<8> some_input; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<8> retval; apply { val = 8w3; tmp = val; - some_input = val; - hasReturned = false; - some_input = 8w1; - hasReturned = true; retval = 8w1; - val = some_input; tmp_0 = retval; tmp_1 = tmp + tmp_0; h.h.a = tmp_1; diff --git a/testdata/p4_16_samples_outputs/issue2221-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue2221-bmv2-frontend.p4 index f68f1c31b3..b2827a8894 100644 --- a/testdata/p4_16_samples_outputs/issue2221-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2221-bmv2-frontend.p4 @@ -23,40 +23,10 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.tmp_0") bit<16> tmp_0; - @name("ingress.tmp_3") bit<16> tmp_3; - @name("ingress.tmp_6") bit<16> tmp_4; - @name("ingress.eth_type_0") bit<16> eth_type_3; - @name("ingress.hasReturned") bool hasReturned; - @name("ingress.retval") bit<16> retval; - @name("ingress.eth_type_1") bit<16> eth_type_4; - @name("ingress.hasReturned") bool hasReturned_1; - @name("ingress.retval") bit<16> retval_1; @name("ingress.eth_type_2") bit<16> eth_type_5; - @name("ingress.hasReturned") bool hasReturned_2; - @name("ingress.retval") bit<16> retval_2; apply { - eth_type_3 = h.eth_hdr.eth_type; - hasReturned = false; - eth_type_3 = 16w0x806; - hasReturned = true; - retval = 16w2; - h.eth_hdr.eth_type = eth_type_3; - tmp_0 = retval; - eth_type_4 = h.eth_hdr.eth_type; - hasReturned_1 = false; - eth_type_4 = 16w0x806; - hasReturned_1 = true; - retval_1 = 16w2; - h.eth_hdr.eth_type = eth_type_4; - tmp_3 = retval_1; - eth_type_5 = h.eth_hdr.eth_type; - hasReturned_2 = false; eth_type_5 = 16w0x806; - hasReturned_2 = true; - retval_2 = 16w2; h.eth_hdr.eth_type = eth_type_5; - tmp_4 = retval_2; } } diff --git a/testdata/p4_16_samples_outputs/issue2221-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue2221-bmv2-midend.p4 index 5dd28506ec..30d66d990b 100644 --- a/testdata/p4_16_samples_outputs/issue2221-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue2221-bmv2-midend.p4 @@ -25,8 +25,6 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @hidden action act() { h.eth_hdr.eth_type = 16w0x806; - h.eth_hdr.eth_type = 16w0x806; - h.eth_hdr.eth_type = 16w0x806; } @hidden table tbl_act { actions = { diff --git a/testdata/p4_16_samples_outputs/issue2225-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue2225-bmv2-frontend.p4 index 7a2900e5f7..14a3c1d58d 100644 --- a/testdata/p4_16_samples_outputs/issue2225-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2225-bmv2-frontend.p4 @@ -25,11 +25,9 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.val_0") bit<16> val; @name("ingress.do_action") action do_action() { - val = h.eth_hdr.eth_type; val = 16w3; h.eth_hdr.eth_type = val; exit; - h.eth_hdr.eth_type = val; } apply { do_action(); diff --git a/testdata/p4_16_samples_outputs/issue2258-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue2258-bmv2-frontend.p4 index 9618de641d..952e2a25fc 100644 --- a/testdata/p4_16_samples_outputs/issue2258-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2258-bmv2-frontend.p4 @@ -24,7 +24,6 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.key_0") bit<16> key_0; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<16> retval; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @@ -38,8 +37,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { default_action = NoAction_1(); } apply { - hasReturned = false; - hasReturned = true; retval = 16w1; key_0 = retval; simple_table_0.apply(); diff --git a/testdata/p4_16_samples_outputs/issue2260-2-frontend.p4 b/testdata/p4_16_samples_outputs/issue2260-2-frontend.p4 index b568235837..e897374ccc 100644 --- a/testdata/p4_16_samples_outputs/issue2260-2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2260-2-frontend.p4 @@ -1,12 +1,7 @@ control C(); package S(C c); control MyC() { - @name("MyC.hasReturned") bool hasReturned; - @name("MyC.retval") bit<8> retval; apply { - hasReturned = false; - hasReturned = true; - retval = 8w255; } } diff --git a/testdata/p4_16_samples_outputs/issue2261-frontend.p4 b/testdata/p4_16_samples_outputs/issue2261-frontend.p4 index ff98375f53..da3bdab5e6 100644 --- a/testdata/p4_16_samples_outputs/issue2261-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2261-frontend.p4 @@ -27,14 +27,11 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<16> retval; @name("ingress.tmp_struct") nested_struct tmp_struct_0; apply { - hasReturned = false; tmp_struct_0.eth_hdr.setValid(); tmp_struct_0 = (nested_struct){eth_hdr = (ethernet_t){dst_addr = 48w0,src_addr = 48w0,eth_type = 16w0}}; - hasReturned = true; retval = tmp_struct_0.eth_hdr.eth_type; h.eth_hdr.eth_type = retval; } diff --git a/testdata/p4_16_samples_outputs/issue2266-frontend.p4 b/testdata/p4_16_samples_outputs/issue2266-frontend.p4 index 5988001218..85611e6e09 100644 --- a/testdata/p4_16_samples_outputs/issue2266-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2266-frontend.p4 @@ -23,16 +23,9 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.val") bit<16> val_0; - @name("ingress.hasReturned") bool hasReturned; - @name("ingress.retval") bit<16> retval; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @name("ingress.simple_action") action simple_action() { - hasReturned = false; - hasReturned = true; - retval = 16w1; - val_0 = retval; } @name("ingress.simple_table") table simple_table_0 { actions = { diff --git a/testdata/p4_16_samples_outputs/issue2279-frontend.p4 b/testdata/p4_16_samples_outputs/issue2279-frontend.p4 index 29062c38ec..7b0457cc7e 100644 --- a/testdata/p4_16_samples_outputs/issue2279-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2279-frontend.p4 @@ -11,7 +11,6 @@ struct Headers { control c(inout Headers hdr) { @name("c.tmp_val") bit<16> tmp_val_0; @name("c.do_action") action do_action() { - hdr.eth_hdr.eth_type = 16w3 + (tmp_val_0 > 16w2 ? 16w3 : 16w1); } @name("c.do_action") action do_action_1() { hdr.eth_hdr.eth_type = 16w3 + (tmp_val_0 > 16w2 ? 16w3 : 16w1); diff --git a/testdata/p4_16_samples_outputs/issue2279-midend.p4 b/testdata/p4_16_samples_outputs/issue2279-midend.p4 index bf7b5cf7dc..70159fc500 100644 --- a/testdata/p4_16_samples_outputs/issue2279-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue2279-midend.p4 @@ -10,7 +10,6 @@ struct Headers { control c(inout Headers hdr) { @name("c.do_action") action do_action() { - hdr.eth_hdr.eth_type = 16w6; } @name("c.do_action") action do_action_1() { hdr.eth_hdr.eth_type = 16w6; diff --git a/testdata/p4_16_samples_outputs/issue2279_1-frontend.p4 b/testdata/p4_16_samples_outputs/issue2279_1-frontend.p4 index 31c1546a20..c08be25a2f 100644 --- a/testdata/p4_16_samples_outputs/issue2279_1-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2279_1-frontend.p4 @@ -11,12 +11,10 @@ struct Headers { control c(inout Headers hdr) { @name("c.tmp_val") bit<16> tmp_val_0; @name("c.do_action") action do_action() { - hdr.eth_hdr.eth_type = 16w3 + (tmp_val_0 > 16w2 ? 16w3 : 16w1); tmp_val_0[7:0] = 8w4; } @name("c.do_action") action do_action_1() { hdr.eth_hdr.eth_type = 16w3 + (tmp_val_0 > 16w2 ? 16w3 : 16w1); - tmp_val_0[7:0] = 8w4; } apply { tmp_val_0 = 16w3; diff --git a/testdata/p4_16_samples_outputs/issue2279_1-midend.p4 b/testdata/p4_16_samples_outputs/issue2279_1-midend.p4 index 4d272154c8..295a291f96 100644 --- a/testdata/p4_16_samples_outputs/issue2279_1-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue2279_1-midend.p4 @@ -11,12 +11,10 @@ struct Headers { control c(inout Headers hdr) { @name("c.tmp_val") bit<16> tmp_val_0; @name("c.do_action") action do_action() { - hdr.eth_hdr.eth_type = 16w6; tmp_val_0[7:0] = 8w4; } @name("c.do_action") action do_action_1() { hdr.eth_hdr.eth_type = 16w3 + (tmp_val_0 > 16w2 ? 16w3 : 16w1); - tmp_val_0[7:0] = 8w4; } @hidden action issue2279_1l12() { tmp_val_0 = 16w3; diff --git a/testdata/p4_16_samples_outputs/issue2279_2-frontend.p4 b/testdata/p4_16_samples_outputs/issue2279_2-frontend.p4 index 7dac2310a3..0e8fd0dd1a 100644 --- a/testdata/p4_16_samples_outputs/issue2279_2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2279_2-frontend.p4 @@ -11,13 +11,11 @@ struct Headers { control c(inout Headers hdr) { @name("c.tmp_val") bit<16> tmp_val_0; @name("c.do_action") action do_action() { - hdr.eth_hdr.eth_type = 16w3 + (tmp_val_0 > 16w2 ? 16w3 : 16w1); } @name("c.do_action") action do_action_1() { hdr.eth_hdr.eth_type = 16w3 + (tmp_val_0 > 16w2 ? 16w3 : 16w1); } apply { - tmp_val_0 = 16w3; do_action(); tmp_val_0 = 16w1; do_action_1(); diff --git a/testdata/p4_16_samples_outputs/issue2279_2-midend.p4 b/testdata/p4_16_samples_outputs/issue2279_2-midend.p4 index 91ce8913a6..b05fe3abff 100644 --- a/testdata/p4_16_samples_outputs/issue2279_2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue2279_2-midend.p4 @@ -10,7 +10,6 @@ struct Headers { control c(inout Headers hdr) { @name("c.do_action") action do_action() { - hdr.eth_hdr.eth_type = 16w6; } @name("c.do_action") action do_action_1() { hdr.eth_hdr.eth_type = 16w4; diff --git a/testdata/p4_16_samples_outputs/issue2279_3-frontend.p4 b/testdata/p4_16_samples_outputs/issue2279_3-frontend.p4 index 0780caefa0..4a543fa59d 100644 --- a/testdata/p4_16_samples_outputs/issue2279_3-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2279_3-frontend.p4 @@ -11,15 +11,12 @@ struct Headers { control c(inout Headers hdr) { @name("c.tmp_val") bool tmp_val_0; @name("c.do_action") action do_action() { - hdr.eth_hdr.eth_type = 16w3 + (tmp_val_0 ? 16w3 : 16w1); tmp_val_0 = true; } @name("c.do_action") action do_action_1() { hdr.eth_hdr.eth_type = 16w3 + (tmp_val_0 ? 16w3 : 16w1); - tmp_val_0 = true; } apply { - tmp_val_0 = false; do_action(); do_action_1(); } diff --git a/testdata/p4_16_samples_outputs/issue2279_3-midend.p4 b/testdata/p4_16_samples_outputs/issue2279_3-midend.p4 index 083de7251a..70159fc500 100644 --- a/testdata/p4_16_samples_outputs/issue2279_3-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue2279_3-midend.p4 @@ -10,7 +10,6 @@ struct Headers { control c(inout Headers hdr) { @name("c.do_action") action do_action() { - hdr.eth_hdr.eth_type = 16w4; } @name("c.do_action") action do_action_1() { hdr.eth_hdr.eth_type = 16w6; diff --git a/testdata/p4_16_samples_outputs/issue2287-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue2287-bmv2-frontend.p4 index 0f0f0d1827..0f2ebecd49 100644 --- a/testdata/p4_16_samples_outputs/issue2287-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2287-bmv2-frontend.p4 @@ -50,194 +50,52 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.dummy_var") bit<8> dummy_var_0; - @name("ingress.tmp_0") bit<8> tmp_0; - @name("ingress.tmp_3") bit<8> tmp_3; - @name("ingress.tmp_6") bit<8> tmp_6; - @name("ingress.tmp_9") bit<8> tmp_9; - @name("ingress.tmp_12") bit<8> tmp_12; - @name("ingress.tmp_15") bit<8> tmp_15; - @name("ingress.tmp_18") bit<8> tmp_18; - @name("ingress.tmp_21") bit<8> tmp_21; - @name("ingress.tmp_24") bit<8> tmp_23; - @name("ingress.tmp_27") bit<8> tmp_24; - @name("ingress.tmp_29") bit<8> tmp_25; - @name("ingress.tmp_31") bit<8> tmp_26; - @name("ingress.tmp_34") bit<8> tmp_27; - @name("ingress.tmp_35") bit<8> tmp_28; - @name("ingress.tmp_38") bit<8> tmp_29; - @name("ingress.tmp_39") bit<8> tmp_30; @name("ingress.val_0") bit<8> val; - @name("ingress.hasReturned") bool hasReturned; - @name("ingress.retval") bit<8> retval; @name("ingress.val_1") bit<8> val_17; - @name("ingress.hasReturned") bool hasReturned_1; - @name("ingress.retval") bit<8> retval_1; @name("ingress.val_2") bit<8> val_18; - @name("ingress.hasReturned") bool hasReturned_2; - @name("ingress.retval") bit<8> retval_2; @name("ingress.val_3") bit<8> val_19; - @name("ingress.hasReturned") bool hasReturned_3; - @name("ingress.retval") bit<8> retval_3; @name("ingress.val_4") bit<8> val_20; - @name("ingress.hasReturned") bool hasReturned_4; - @name("ingress.retval") bit<8> retval_4; @name("ingress.val_5") bit<8> val_21; - @name("ingress.hasReturned") bool hasReturned_5; - @name("ingress.retval") bit<8> retval_5; @name("ingress.val_6") bit<8> val_22; - @name("ingress.hasReturned") bool hasReturned_6; - @name("ingress.retval") bit<8> retval_6; @name("ingress.val_7") bit<8> val_23; - @name("ingress.hasReturned") bool hasReturned_7; - @name("ingress.retval") bit<8> retval_7; @name("ingress.val_8") bit<8> val_24; - @name("ingress.hasReturned") bool hasReturned_8; - @name("ingress.retval") bit<8> retval_8; @name("ingress.val_9") bit<8> val_25; - @name("ingress.hasReturned") bool hasReturned_9; - @name("ingress.retval") bit<8> retval_9; @name("ingress.val_10") bit<8> val_26; - @name("ingress.hasReturned") bool hasReturned_10; - @name("ingress.retval") bit<8> retval_10; @name("ingress.val_11") bit<8> val_27; - @name("ingress.hasReturned") bool hasReturned_11; - @name("ingress.retval") bit<8> retval_11; @name("ingress.val_12") bit<8> val_28; - @name("ingress.hasReturned") bool hasReturned_12; - @name("ingress.retval") bit<8> retval_12; - @name("ingress.val_13") bit<8> val_29; - @name("ingress.hasReturned") bool hasReturned_13; - @name("ingress.retval") bit<8> retval_13; @name("ingress.val_14") bit<8> val_30; - @name("ingress.hasReturned") bool hasReturned_14; - @name("ingress.retval") bit<8> retval_14; - @name("ingress.val_15") bit<8> val_31; - @name("ingress.hasReturned") bool hasReturned_15; - @name("ingress.retval") bit<8> retval_15; @name("ingress.val_16") bit<8> val_32; - @name("ingress.hasReturned") bool hasReturned_16; - @name("ingress.retval") bit<8> retval_16; apply { - val = h.h.a; - hasReturned = false; val = 8w1; - hasReturned = true; - retval = 8w2; h.h.a = val; - tmp_0 = retval; - val_17 = h.h.b; - hasReturned_1 = false; val_17 = 8w1; - hasReturned_1 = true; - retval_1 = 8w2; h.h.b = val_17; - tmp_3 = retval_1; - val_18 = h.h.c; - hasReturned_2 = false; val_18 = 8w1; - hasReturned_2 = true; - retval_2 = 8w2; h.h.c = val_18; - tmp_6 = retval_2; - val_19 = h.h.d; - hasReturned_3 = false; val_19 = 8w1; - hasReturned_3 = true; - retval_3 = 8w2; h.h.d = val_19; - tmp_9 = retval_3; - val_20 = h.h.e; - hasReturned_4 = false; val_20 = 8w1; - hasReturned_4 = true; - retval_4 = 8w2; h.h.e = val_20; - tmp_12 = retval_4; - val_21 = h.h.f; - hasReturned_5 = false; val_21 = 8w1; - hasReturned_5 = true; - retval_5 = 8w2; h.h.f = val_21; - tmp_15 = retval_5; - val_22 = h.h.g; - hasReturned_6 = false; val_22 = 8w1; - hasReturned_6 = true; - retval_6 = 8w2; h.h.g = val_22; - dummy_var_0 = retval_6; - val_23 = h.h.h; - hasReturned_7 = false; val_23 = 8w1; - hasReturned_7 = true; - retval_7 = 8w2; h.h.h = val_23; - tmp_18 = retval_7; - val_24 = h.h.i; - hasReturned_8 = false; val_24 = 8w1; - hasReturned_8 = true; - retval_8 = 8w2; h.h.i = val_24; - tmp_21 = retval_8; - val_25 = h.h.j; - hasReturned_9 = false; val_25 = 8w1; - hasReturned_9 = true; - retval_9 = 8w2; h.h.j = val_25; - tmp_23 = retval_9; - val_26 = h.h.k; - hasReturned_10 = false; val_26 = 8w1; - hasReturned_10 = true; - retval_10 = 8w2; h.h.k = val_26; - tmp_24 = retval_10; - val_27 = h.h.l; - hasReturned_11 = false; val_27 = 8w1; - hasReturned_11 = true; - retval_11 = 8w2; h.h.l = val_27; - tmp_25 = retval_11; - val_28 = h.h.m; - hasReturned_12 = false; val_28 = 8w1; - hasReturned_12 = true; - retval_12 = 8w2; h.h.m = val_28; - tmp_26 = retval_12; - val_29 = h.b.c; - hasReturned_13 = false; - val_29 = 8w1; - hasReturned_13 = true; - retval_13 = 8w2; - h.b.c = val_29; - tmp_27 = retval_13; - val_30 = h.b.c; - hasReturned_14 = false; val_30 = 8w1; - hasReturned_14 = true; - retval_14 = 8w2; h.b.c = val_30; - tmp_28 = retval_14; - val_31 = h.b.d; - hasReturned_15 = false; - val_31 = 8w1; - hasReturned_15 = true; - retval_15 = 8w2; - h.b.d = val_31; - tmp_29 = retval_15; - val_32 = h.b.d; - hasReturned_16 = false; val_32 = 8w1; - hasReturned_16 = true; - retval_16 = 8w2; h.b.d = val_32; - tmp_30 = retval_16; } } diff --git a/testdata/p4_16_samples_outputs/issue2287-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue2287-bmv2-midend.p4 index d6089e83c3..f8d9846d43 100644 --- a/testdata/p4_16_samples_outputs/issue2287-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue2287-bmv2-midend.p4 @@ -65,8 +65,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { h.h.l = 8w1; h.h.m = 8w1; h.b.c = 8w1; - h.b.c = 8w1; - h.b.d = 8w1; h.b.d = 8w1; } @hidden table tbl_act { diff --git a/testdata/p4_16_samples_outputs/issue2288-1-frontend.p4 b/testdata/p4_16_samples_outputs/issue2288-1-frontend.p4 index 4d3eafe361..feee2ae712 100644 --- a/testdata/p4_16_samples_outputs/issue2288-1-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2288-1-frontend.p4 @@ -11,27 +11,19 @@ control ingress(inout Headers h) { @name("ingress.tmp") bit<8> tmp; @name("ingress.tmp_0") bit<8> tmp_0; @name("ingress.w_0") bit<8> w; - @name("ingress.hasReturned_0") bool hasReturned; @name("ingress.retval_0") bit<8> retval; @name("ingress.x_0") bit<8> x; @name("ingress.y_0") bit<8> y; @name("ingress.z_0") bit<8> z; - @name("ingress.hasReturned") bool hasReturned_0; - @name("ingress.retval") bit<8> retval_0; apply { tmp = h.h.a; - hasReturned = false; w = 8w3; - hasReturned = true; retval = 8w1; h.h.a = w; tmp_0 = retval; x = tmp; y = tmp_0; - hasReturned_0 = false; z = x | y; - hasReturned_0 = true; - retval_0 = 8w4; h.h.b = z; } } diff --git a/testdata/p4_16_samples_outputs/issue2288-2-frontend.p4 b/testdata/p4_16_samples_outputs/issue2288-2-frontend.p4 index 438553f103..71863c37af 100644 --- a/testdata/p4_16_samples_outputs/issue2288-2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2288-2-frontend.p4 @@ -4,27 +4,14 @@ struct Headers { } control ingress(inout Headers h) { - @name("ingress.tmp") bit<8> tmp; @name("ingress.tmp_0") bit<8> tmp_0; @name("ingress.z_0") bit<8> z; - @name("ingress.hasReturned") bool hasReturned; - @name("ingress.retval") bit<8> retval; @name("ingress.x_0") bit<8> x; - @name("ingress.hasReturned_0") bool hasReturned_0; - @name("ingress.retval_0") bit<8> retval_0; apply { - z = h.a; - hasReturned = false; z = 8w3; - hasReturned = true; - retval = 8w1; h.a = z; - tmp = retval; tmp_0 = h.a; x = tmp_0; - hasReturned_0 = false; - hasReturned_0 = true; - retval_0 = 8w4; tmp_0 = x; h.a = tmp_0; } diff --git a/testdata/p4_16_samples_outputs/issue2288-frontend.p4 b/testdata/p4_16_samples_outputs/issue2288-frontend.p4 index 495c9d8b8b..1d3c341f7c 100644 --- a/testdata/p4_16_samples_outputs/issue2288-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2288-frontend.p4 @@ -8,19 +8,9 @@ struct Headers { control ingress(inout Headers h) { @name("ingress.tmp") bit<8> tmp; @name("ingress.tmp_0") bool tmp_0; - @name("ingress.tmp_1") bit<8> tmp_1; - @name("ingress.tmp_2") bit<8> tmp_2; @name("ingress.tmp_3") bit<8> tmp_3; - @name("ingress.tmp_4") bit<8> tmp_4; @name("ingress.x_0") bit<8> x; - @name("ingress.hasReturned") bool hasReturned; - @name("ingress.retval") bit<8> retval; - @name("ingress.z_1") bit<8> z; - @name("ingress.hasReturned_0") bool hasReturned_0; - @name("ingress.retval_0") bit<8> retval_0; @name("ingress.x_1") bit<8> x_2; - @name("ingress.hasReturned") bool hasReturned_3; - @name("ingress.retval") bit<8> retval_3; @name("ingress.a") action a_1() { h.b = 8w0; } @@ -36,30 +26,11 @@ control ingress(inout Headers h) { apply { tmp = h.a; tmp_0 = t_0.apply().hit; - if (tmp_0) { - tmp_1 = h.a; - } else { - tmp_1 = h.b; - } - tmp_2 = tmp_1; x = tmp; - hasReturned = false; - hasReturned = true; - retval = 8w4; tmp = x; h.a = tmp; tmp_3 = h.a; - z = h.a; - hasReturned_0 = false; - z = 8w3; - hasReturned_0 = true; - retval_0 = 8w1; - h.a = z; - tmp_4 = retval_0; x_2 = tmp_3; - hasReturned_3 = false; - hasReturned_3 = true; - retval_3 = 8w4; tmp_3 = x_2; h.a = tmp_3; } diff --git a/testdata/p4_16_samples_outputs/issue2288-midend.p4 b/testdata/p4_16_samples_outputs/issue2288-midend.p4 index b272f9c3ba..0fd56c5aa5 100644 --- a/testdata/p4_16_samples_outputs/issue2288-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue2288-midend.p4 @@ -6,7 +6,6 @@ struct Headers { } control ingress(inout Headers h) { - @name("ingress.tmp_3") bit<8> tmp_3; @name("ingress.a") action a_1() { h.b = 8w0; } @@ -19,20 +18,8 @@ control ingress(inout Headers h) { } default_action = a_1(); } - @hidden action act() { - tmp_3 = h.a; - h.a = 8w3; - h.a = tmp_3; - } - @hidden table tbl_act { - actions = { - act(); - } - const default_action = act(); - } apply { t_0.apply(); - tbl_act.apply(); } } diff --git a/testdata/p4_16_samples_outputs/issue2289-frontend.p4 b/testdata/p4_16_samples_outputs/issue2289-frontend.p4 index e2536399cb..fdbc417220 100644 --- a/testdata/p4_16_samples_outputs/issue2289-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2289-frontend.p4 @@ -31,35 +31,11 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.tmp_0") bit<16> tmp; @name("ingress.byaA") bit<16> byaA_0; - @name("ingress.hasReturned") bool hasReturned; - @name("ingress.retval") bit<16> retval; - @name("ingress.hasReturned_0") bool hasReturned_0; - @name("ingress.retval_0") bit<16> retval_0; - @name("ingress.tmp") bit<16> tmp_0; - @name("ingress.hasReturned") bool hasReturned_3; - @name("ingress.retval") bit<16> retval_3; - @name("ingress.hasReturned") bool hasReturned_4; - @name("ingress.retval") bit<16> retval_4; @name("ingress.simple_action") action simple_action() { - hasReturned = false; - hasReturned = true; - retval = 16w1; - tmp = retval; - hasReturned_0 = false; - hasReturned_3 = false; - hasReturned_3 = true; - retval_3 = 16w1; - tmp_0 = retval_3; - hasReturned_0 = true; - retval_0 = tmp_0; h.eth_hdr.eth_type = byaA_0; } apply { - hasReturned_4 = false; - hasReturned_4 = true; - retval_4 = 16w1; simple_action(); } } diff --git a/testdata/p4_16_samples_outputs/issue2289.p4-stderr b/testdata/p4_16_samples_outputs/issue2289.p4-stderr index b046657e5f..278298d107 100644 --- a/testdata/p4_16_samples_outputs/issue2289.p4-stderr +++ b/testdata/p4_16_samples_outputs/issue2289.p4-stderr @@ -7,3 +7,6 @@ issue2289.p4(44): [--Wwarn=uninitialized_out_param] warning: out parameter 'byaA issue2289.p4(44) action simple_action(out bit<16> byaA) { ^^^^^^^^^^^^^ +issue2289.p4(44): [--Wwarn=uninitialized_use] warning: byaA may be uninitialized + action simple_action(out bit<16> byaA) { + ^^^^ diff --git a/testdata/p4_16_samples_outputs/issue2291-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue2291-bmv2-frontend.p4 index 6ae7c9d14d..22414a8a76 100644 --- a/testdata/p4_16_samples_outputs/issue2291-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2291-bmv2-frontend.p4 @@ -23,38 +23,9 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.tmp_0") bit<16> tmp; - @name("ingress.hasReturned") bool hasReturned; - @name("ingress.retval") bit<16> retval; - @name("ingress.hasReturned_0") bool hasReturned_0; - @name("ingress.retval_0") bit<16> retval_0; - @name("ingress.tmp") bit<16> tmp_0; - @name("ingress.hasReturned") bool hasReturned_3; - @name("ingress.retval") bit<16> retval_3; - @name("ingress.hasReturned") bool hasReturned_4; - @name("ingress.retval") bit<16> retval_4; - @name("ingress.hasReturned") bool hasReturned_5; - @name("ingress.retval") bit<16> retval_5; @name("ingress.simple_action") action simple_action() { - hasReturned = false; - hasReturned = true; - retval = 16w4; - hasReturned_0 = false; - hasReturned_3 = false; - hasReturned_3 = true; - retval_3 = 16w4; - tmp_0 = retval_3; - hasReturned_0 = true; - retval_0 = tmp_0; } apply { - hasReturned_4 = false; - hasReturned_4 = true; - retval_4 = 16w4; - tmp = retval_4; - hasReturned_5 = false; - hasReturned_5 = true; - retval_5 = 16w4; simple_action(); } } diff --git a/testdata/p4_16_samples_outputs/issue232-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue232-bmv2-frontend.p4 index 2d243e34ff..796f512cd0 100644 --- a/testdata/p4_16_samples_outputs/issue232-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue232-bmv2-frontend.p4 @@ -31,22 +31,14 @@ control Eg(inout Headers hdrs, inout Metadata meta, inout standard_metadata_t st @name("Eg.inKey") Key inKey_0; @name("Eg.defaultKey") Key defaultKey_0; @name("Eg.same") bool same_0; - @name("Eg.val") Value val; @name("Eg.done") bool done_0; @name("Eg.ok") bool ok_0; - @name("Eg.val") Value val_0; @name("Eg.test") action test() { inKey_0 = (Key){field1 = 32w1}; defaultKey_0 = (Key){field1 = 32w0}; same_0 = inKey_0 == defaultKey_0; - val = (Value){field1 = 32w0}; done_0 = false; ok_0 = !done_0 && same_0; - if (ok_0) { - val_0 = val; - val_0.field1 = 32w8; - val = val_0; - } } apply { test(); diff --git a/testdata/p4_16_samples_outputs/issue2321-frontend.p4 b/testdata/p4_16_samples_outputs/issue2321-frontend.p4 index 584dc90478..9f9280af9d 100644 --- a/testdata/p4_16_samples_outputs/issue2321-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2321-frontend.p4 @@ -33,10 +33,8 @@ control ingressImpl(inout headers_t hdr, inout metadata_t meta, inout standard_m @name("ingressImpl.y") bit<16> y_0; @name("ingressImpl.z") bit<16> z_0; @name("ingressImpl.x_0") bit<16> x_3; - @name("ingressImpl.hasReturned") bool hasReturned; @name("ingressImpl.retval") bit<16> retval; @name("ingressImpl.x_2") bit<16> x_4; - @name("ingressImpl.hasReturned") bool hasReturned_1; @name("ingressImpl.retval") bit<16> retval_1; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @@ -51,16 +49,12 @@ control ingressImpl(inout headers_t hdr, inout metadata_t meta, inout standard_m } @name("ingressImpl.a2") action a2() { x_3 = hdr.ethernet.etherType; - hasReturned = false; x_3 = x_3 | 16w7; - hasReturned = true; retval = x_3 >> 1; hdr.ethernet.etherType = x_3; y_0 = retval; x_4 = hdr.ethernet.etherType; - hasReturned_1 = false; x_4 = x_4 | 16w7; - hasReturned_1 = true; retval_1 = x_4 >> 1; hdr.ethernet.etherType = x_4; z_0 = retval_1; diff --git a/testdata/p4_16_samples_outputs/issue2330-1-frontend.p4 b/testdata/p4_16_samples_outputs/issue2330-1-frontend.p4 index 33fcb8e7ec..14b8a808af 100644 --- a/testdata/p4_16_samples_outputs/issue2330-1-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2330-1-frontend.p4 @@ -27,7 +27,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp") bit<48> tmp; @name("ingress.hasReturned") bool hasReturned; @name("ingress.val1_0") bit<16> val1; - @name("ingress.val2_0") bit<48> val2; @name("ingress.do_action") action do_action() { hasReturned = false; pointless_bool_0 = true; @@ -40,9 +39,7 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { ; } else { val1 = h.eth_hdr.eth_type; - val2 = h.eth_hdr.src_addr; h.eth_hdr.eth_type = val1; - h.eth_hdr.src_addr = val2; if (pointless_bool_0) { tmp = 48w1; } else { diff --git a/testdata/p4_16_samples_outputs/issue2330-1-midend.p4 b/testdata/p4_16_samples_outputs/issue2330-1-midend.p4 index 49550adbb2..2f89c964cb 100644 --- a/testdata/p4_16_samples_outputs/issue2330-1-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue2330-1-midend.p4 @@ -25,12 +25,9 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp") bit<48> tmp; @name("ingress.val1_0") bit<16> val1; - @name("ingress.val2_0") bit<48> val2; @name("ingress.do_action") action do_action() { val1 = (h.eth_hdr.dst_addr != 48w0 ? h.eth_hdr.eth_type : val1); - val2 = (h.eth_hdr.dst_addr != 48w0 ? h.eth_hdr.src_addr : val2); h.eth_hdr.eth_type = (h.eth_hdr.dst_addr != 48w0 ? val1 : h.eth_hdr.eth_type); - h.eth_hdr.src_addr = (h.eth_hdr.dst_addr != 48w0 ? val2 : h.eth_hdr.src_addr); tmp = (h.eth_hdr.dst_addr != 48w0 ? 48w1 : tmp); h.eth_hdr.src_addr = (h.eth_hdr.dst_addr != 48w0 ? tmp : h.eth_hdr.src_addr); } diff --git a/testdata/p4_16_samples_outputs/issue2343-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue2343-bmv2-frontend.p4 index 4781afb245..dc9427531a 100644 --- a/testdata/p4_16_samples_outputs/issue2343-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2343-bmv2-frontend.p4 @@ -26,13 +26,9 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp") bit<16> tmp; @name("ingress.tmp_0") bit<16> tmp_0; @name("ingress.val_0") bit<48> val; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<16> retval; apply { - val = h.eth_hdr.dst_addr; - hasReturned = false; val = 48w1; - hasReturned = true; retval = 16w1; h.eth_hdr.dst_addr = val; tmp = retval; diff --git a/testdata/p4_16_samples_outputs/issue2344-frontend.p4 b/testdata/p4_16_samples_outputs/issue2344-frontend.p4 index 03194ba2a8..efed8053ff 100644 --- a/testdata/p4_16_samples_outputs/issue2344-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2344-frontend.p4 @@ -15,18 +15,15 @@ struct Meta { } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<32> retval; @name("ingress.tmp1") H tmp1_0; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @name("ingress.simple_action") action simple_action() { - hasReturned = false; tmp1_0.setInvalid(); if (tmp1_0.a != 32w10) { tmp1_0.a = tmp1_0.a + 32w10; } - hasReturned = true; retval = tmp1_0.a; h.h.a = retval; } diff --git a/testdata/p4_16_samples_outputs/issue2355-frontend.p4 b/testdata/p4_16_samples_outputs/issue2355-frontend.p4 index faca3cbc7b..5fc1659948 100644 --- a/testdata/p4_16_samples_outputs/issue2355-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2355-frontend.p4 @@ -23,23 +23,7 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.tmp_0") bit<8> tmp; - @name("ingress.tmp_1") bool tmp_0; - @name("ingress.tmp_2") bool tmp_1; - @name("ingress.hasReturned_0") bool hasReturned; - @name("ingress.retval_0") bit<8> retval; - @name("ingress.hasReturned") bool hasReturned_0; - @name("ingress.retval") bit<8> retval_0; apply { - hasReturned = false; - hasReturned = true; - retval = 8w1; - tmp = retval; - tmp_0 = tmp == 8w1; - tmp_1 = tmp_0; - hasReturned_0 = false; - hasReturned_0 = true; - retval_0 = 8w1; } } diff --git a/testdata/p4_16_samples_outputs/issue2356-frontend.p4 b/testdata/p4_16_samples_outputs/issue2356-frontend.p4 index 51339777b0..5fc1659948 100644 --- a/testdata/p4_16_samples_outputs/issue2356-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2356-frontend.p4 @@ -23,12 +23,7 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.hasReturned") bool hasReturned; - @name("ingress.retval") bit<16> retval; apply { - hasReturned = false; - hasReturned = true; - retval = 16w1; } } diff --git a/testdata/p4_16_samples_outputs/issue2375-1-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue2375-1-bmv2-frontend.p4 index 07c4cb71b0..60b4c3eb9e 100644 --- a/testdata/p4_16_samples_outputs/issue2375-1-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2375-1-bmv2-frontend.p4 @@ -23,22 +23,9 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.tmp") bool tmp_0; - @name("ingress.val") bool val; - @name("ingress.val_0") bool val_2; - @name("ingress.hasReturned") bool hasReturned; - @name("ingress.retval") bit<32> retval; @name("ingress.do_action") action do_action() { - val = tmp_0; - val_2 = tmp_0; - hasReturned = false; - hasReturned = true; - retval = 32w1; - tmp_0 = val_2; - tmp_0 = val; } apply { - tmp_0 = false; do_action(); } } diff --git a/testdata/p4_16_samples_outputs/issue2375-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue2375-bmv2-frontend.p4 index b6c074fe5b..ea25e987ff 100644 --- a/testdata/p4_16_samples_outputs/issue2375-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2375-bmv2-frontend.p4 @@ -23,16 +23,9 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.tmp") bool tmp_0; - @name("ingress.val1") bool val1_0; - @name("ingress.val2") bool val2_0; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @name("ingress.do_action") action do_action() { - val1_0 = tmp_0; - val2_0 = tmp_0; - tmp_0 = val1_0; - tmp_0 = val2_0; } @name("ingress.simple_table") table simple_table_0 { actions = { @@ -42,7 +35,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { default_action = NoAction_1(); } apply { - tmp_0 = false; simple_table_0.apply(); } } diff --git a/testdata/p4_16_samples_outputs/issue2383-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue2383-bmv2-frontend.p4 index 3b40ec3574..cb5161a67f 100644 --- a/testdata/p4_16_samples_outputs/issue2383-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2383-bmv2-frontend.p4 @@ -23,11 +23,8 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") ethernet_t retval; apply { - hasReturned = false; - hasReturned = true; retval.setValid(); retval = (ethernet_t){dst_addr = 48w1,src_addr = 48w1,eth_type = 16w1}; h.eth_hdr = retval; diff --git a/testdata/p4_16_samples_outputs/issue2393-frontend.p4 b/testdata/p4_16_samples_outputs/issue2393-frontend.p4 index 81c07145c5..5ceb77d74e 100644 --- a/testdata/p4_16_samples_outputs/issue2393-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2393-frontend.p4 @@ -9,27 +9,11 @@ struct Headers { } control ingress(inout Headers h) { - @name("ingress.tmp") bit<16> tmp; - @name("ingress.filler_bool") bool filler_bool_0; - @name("ingress.tmp_bool") bool tmp_bool_0; - @name("ingress.tmp") bool tmp_0; - @name("ingress.make_zero") bool make_zero_0; - @name("ingress.val_undefined") bool val_undefined_0; - @name("ingress.tmp") bit<16> tmp_4; - @name("ingress.make_zero") bool make_zero_2; - @name("ingress.val_undefined") bool val_undefined_2; @name(".do_global_action") action do_global_action_0() { - make_zero_2 = true; - tmp = tmp * (make_zero_2 ? 16w0 : 16w1); - filler_bool_0 = val_undefined_2; } @noWarn("unused") @name(".NoAction") action NoAction_1() { } @name("ingress.do_action") action do_action() { - tmp_0 = tmp_bool_0; - make_zero_0 = tmp_0; - tmp_4 = tmp_4 * (make_zero_0 ? 16w0 : 16w1); - tmp_bool_0 = val_undefined_0; } @name("ingress.simple_table") table simple_table_0 { key = { @@ -43,7 +27,6 @@ control ingress(inout Headers h) { default_action = NoAction_1(); } apply { - tmp_bool_0 = false; simple_table_0.apply(); } } diff --git a/testdata/p4_16_samples_outputs/issue2393-midend.p4 b/testdata/p4_16_samples_outputs/issue2393-midend.p4 index 4f41ebb9ef..5ceb77d74e 100644 --- a/testdata/p4_16_samples_outputs/issue2393-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue2393-midend.p4 @@ -9,18 +9,11 @@ struct Headers { } control ingress(inout Headers h) { - @name("ingress.tmp") bit<16> tmp; - @name("ingress.tmp_bool") bool tmp_bool_0; - @name("ingress.val_undefined") bool val_undefined_0; - @name("ingress.tmp") bit<16> tmp_4; @name(".do_global_action") action do_global_action_0() { - tmp = 16w0; } @noWarn("unused") @name(".NoAction") action NoAction_1() { } @name("ingress.do_action") action do_action() { - tmp_4 = tmp_4 * (tmp_bool_0 ? 16w0 : 16w1); - tmp_bool_0 = val_undefined_0; } @name("ingress.simple_table") table simple_table_0 { key = { @@ -33,17 +26,7 @@ control ingress(inout Headers h) { } default_action = NoAction_1(); } - @hidden action issue2393l18() { - tmp_bool_0 = false; - } - @hidden table tbl_issue2393l18 { - actions = { - issue2393l18(); - } - const default_action = issue2393l18(); - } apply { - tbl_issue2393l18.apply(); simple_table_0.apply(); } } diff --git a/testdata/p4_16_samples_outputs/issue2393.p4-stderr b/testdata/p4_16_samples_outputs/issue2393.p4-stderr index 70d2610395..e3954d63af 100644 --- a/testdata/p4_16_samples_outputs/issue2393.p4-stderr +++ b/testdata/p4_16_samples_outputs/issue2393.p4-stderr @@ -10,3 +10,7 @@ action do_global_action(in bool make_zero, out bool val_undefined) { issue2393.p4(11) action do_global_action(in bool make_zero, out bool val_undefined) { ^^^^^^^^^^^^^^^^ +[--Wwarn=uninitialized_use] warning: val_undefined may be uninitialized +issue2393.p4(11): [--Wwarn=uninitialized_use] warning: val_undefined may be uninitialized +action do_global_action(in bool make_zero, out bool val_undefined) { + ^^^^^^^^^^^^^ diff --git a/testdata/p4_16_samples_outputs/issue2488-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue2488-bmv2-frontend.p4 index 2993ddb1ea..14056d5a73 100644 --- a/testdata/p4_16_samples_outputs/issue2488-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2488-bmv2-frontend.p4 @@ -33,32 +33,16 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp_2") bit<48> tmp_2; @name("ingress.tmp_3") bit<48> tmp_3; @name("ingress.tmp_4") bit<16> tmp_4; - @name("ingress.s_0") bit<48> s; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<48> retval; - @name("ingress.s_1") bit<48> s_2; - @name("ingress.hasReturned") bool hasReturned_1; - @name("ingress.retval") bit<48> retval_1; apply { tmp_1 = h.eth_hdr.dst_addr; - s = h.eth_hdr.dst_addr; - hasReturned = false; - s = 48w1; - hasReturned = true; retval = 48w2; - h.eth_hdr.dst_addr = s; tmp_3 = retval; tmp_2 = tmp_3; tmp_4 = 16w1; tmp_0.setValid(); tmp_0 = (ethernet_t){dst_addr = tmp_1,src_addr = tmp_2,eth_type = tmp_4}; tmp = (Headers){eth_hdr = tmp_0}; - s_2 = h.eth_hdr.dst_addr; - hasReturned_1 = false; - s_2 = 48w1; - hasReturned_1 = true; - retval_1 = 48w2; - h.eth_hdr.dst_addr = s_2; h = tmp; } } diff --git a/testdata/p4_16_samples_outputs/issue2488-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue2488-bmv2-midend.p4 index 1e469e76ba..dfc8b05932 100644 --- a/testdata/p4_16_samples_outputs/issue2488-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue2488-bmv2-midend.p4 @@ -28,15 +28,11 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp") ethernet_t tmp_0; - @name("ingress.tmp_1") bit<48> tmp_1; @hidden action issue2488bmv2l40() { - tmp_1 = h.eth_hdr.dst_addr; - h.eth_hdr.dst_addr = 48w1; tmp_0.setValid(); - tmp_0.dst_addr = tmp_1; + tmp_0.dst_addr = h.eth_hdr.dst_addr; tmp_0.src_addr = 48w2; tmp_0.eth_type = 16w1; - h.eth_hdr.dst_addr = 48w1; h.eth_hdr = tmp_0; } @hidden table tbl_issue2488bmv2l40 { diff --git a/testdata/p4_16_samples_outputs/issue2498-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue2498-bmv2-frontend.p4 index aaedb83ebf..bd6d86fc81 100644 --- a/testdata/p4_16_samples_outputs/issue2498-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2498-bmv2-frontend.p4 @@ -32,13 +32,11 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp") bit<1> tmp; @name("ingress.sliced_val") bit<1> sliced_val_0; @name("ingress.slice_action") action slice_action() { - sliced_val_0 = tmp; h.h.a = 8w2; sliced_val_0 = 1w1; tmp = sliced_val_0; } apply { - tmp = h.h.a[0:0]; slice_action(); h.h.a[0:0] = tmp; } diff --git a/testdata/p4_16_samples_outputs/issue2498-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue2498-bmv2-midend.p4 index 26db369936..50a7945429 100644 --- a/testdata/p4_16_samples_outputs/issue2498-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue2498-bmv2-midend.p4 @@ -35,33 +35,23 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { tmp = 1w1; } @hidden action act() { - tmp = h.h.a[0:0]; - } - @hidden action act_0() { h.h.a[0:0] = tmp; } - @hidden table tbl_act { - actions = { - act(); - } - const default_action = act(); - } @hidden table tbl_slice_action { actions = { slice_action(); } const default_action = slice_action(); } - @hidden table tbl_act_0 { + @hidden table tbl_act { actions = { - act_0(); + act(); } - const default_action = act_0(); + const default_action = act(); } apply { - tbl_act.apply(); tbl_slice_action.apply(); - tbl_act_0.apply(); + tbl_act.apply(); } } diff --git a/testdata/p4_16_samples_outputs/issue2543-1-frontend.p4 b/testdata/p4_16_samples_outputs/issue2543-1-frontend.p4 index 7f331b43dd..39258f1402 100644 --- a/testdata/p4_16_samples_outputs/issue2543-1-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2543-1-frontend.p4 @@ -11,18 +11,9 @@ struct Headers { } control ingress(inout Headers h) { - @name("ingress.hasReturned") bool hasReturned; - @name("ingress.retval") bit<16> retval; - @name("ingress.hasReturned_0") bool hasReturned_0; @name("ingress.retval_0") ethernet_t retval_0; apply { - hasReturned = false; - hasReturned = true; - retval = 16w1; - hasReturned_0 = false; - hasReturned_0 = true; retval_0.setValid(); - retval_0 = (ethernet_t){dst_addr = 48w1,src_addr = 48w1,eth_type = 16w1}; } } diff --git a/testdata/p4_16_samples_outputs/issue2543-1-midend.p4 b/testdata/p4_16_samples_outputs/issue2543-1-midend.p4 index c98e323e00..ef5a7785f2 100644 --- a/testdata/p4_16_samples_outputs/issue2543-1-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue2543-1-midend.p4 @@ -12,20 +12,17 @@ struct Headers { control ingress(inout Headers h) { @name("ingress.retval_0") ethernet_t retval_0; - @hidden action issue25431l17() { + @hidden action act() { retval_0.setValid(); - retval_0.dst_addr = 48w1; - retval_0.src_addr = 48w1; - retval_0.eth_type = 16w1; } - @hidden table tbl_issue25431l17 { + @hidden table tbl_act { actions = { - issue25431l17(); + act(); } - const default_action = issue25431l17(); + const default_action = act(); } apply { - tbl_issue25431l17.apply(); + tbl_act.apply(); } } diff --git a/testdata/p4_16_samples_outputs/issue2543-2-frontend.p4 b/testdata/p4_16_samples_outputs/issue2543-2-frontend.p4 index 05dcb95bde..1e501c2f3d 100644 --- a/testdata/p4_16_samples_outputs/issue2543-2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2543-2-frontend.p4 @@ -11,27 +11,21 @@ struct Headers { } control ingress(inout Headers h) { - @name("ingress.hasReturned_0") bool hasReturned; @name("ingress.retval_0") Headers retval; @name("ingress.tmp") ethernet_t tmp; @name("ingress.tmp_0") bit<48> tmp_0; @name("ingress.tmp_1") bit<48> tmp_1; @name("ingress.tmp_2") bit<16> tmp_2; @name("ingress.tmp_3") bit<16> tmp_3; - @name("ingress.hasReturned") bool hasReturned_0; @name("ingress.retval") bit<16> retval_0; apply { - hasReturned = false; tmp_0 = 48w1; tmp_1 = 48w1; - hasReturned_0 = false; - hasReturned_0 = true; retval_0 = 16w9; tmp_3 = retval_0; tmp_2 = tmp_3; tmp.setValid(); tmp = (ethernet_t){dst_addr = tmp_0,src_addr = tmp_1,eth_type = tmp_2}; - hasReturned = true; retval = (Headers){eth_hdr = tmp}; h = retval; } diff --git a/testdata/p4_16_samples_outputs/issue2797_ebpf-frontend.p4 b/testdata/p4_16_samples_outputs/issue2797_ebpf-frontend.p4 index a93f523dac..3322de540c 100644 --- a/testdata/p4_16_samples_outputs/issue2797_ebpf-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2797_ebpf-frontend.p4 @@ -21,15 +21,12 @@ parser prs(packet_in p, out Headers_t headers) { } control pipe(inout Headers_t headers, out bool pass) { - @name("pipe.hasReturned") bool hasReturned; apply { - hasReturned = false; pass = true; if (headers.x.isValid()) { ; } else { pass = false; - hasReturned = true; } } } diff --git a/testdata/p4_16_samples_outputs/issue2900-frontend.p4 b/testdata/p4_16_samples_outputs/issue2900-frontend.p4 index 27635ee059..dca78f3411 100644 --- a/testdata/p4_16_samples_outputs/issue2900-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2900-frontend.p4 @@ -57,7 +57,6 @@ control MainControlImpl(inout headers_t hdr, inout main_metadata_t meta, in pna_ @name("MainControlImpl.key_2") bit<8> key_2; @name("MainControlImpl.tmp") bool tmp; @name("MainControlImpl.istd_0") pna_main_input_metadata_t istd_1; - @name("MainControlImpl.hasReturned") bool hasReturned; @name("MainControlImpl.retval") bool retval; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @@ -74,8 +73,6 @@ control MainControlImpl(inout headers_t hdr, inout main_metadata_t meta, in pna_ } apply { istd_1 = istd; - hasReturned = false; - hasReturned = true; retval = istd_1.direction == PNA_Direction_t.HOST_TO_NET; tmp = retval; if (tmp) { diff --git a/testdata/p4_16_samples_outputs/issue2956-frontend.p4 b/testdata/p4_16_samples_outputs/issue2956-frontend.p4 index 3393f42702..1fa5e0ece9 100644 --- a/testdata/p4_16_samples_outputs/issue2956-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2956-frontend.p4 @@ -21,10 +21,8 @@ control ingress(inout Headers h) { @noWarn("unused") @name(".NoAction") action NoAction_1() { } @name("ingress.simple_assign") action simple_assign() { - h.eth_hdr.eth_type = 16w1; } @name("ingress.simple_assign") action simple_assign_1() { - h.eth_hdr.eth_type = 16w1; } @name("ingress.simple_assign") action simple_assign_2() { h.eth_hdr.eth_type = 16w1; diff --git a/testdata/p4_16_samples_outputs/issue2956-midend.p4 b/testdata/p4_16_samples_outputs/issue2956-midend.p4 index afc864f919..f5be89bf39 100644 --- a/testdata/p4_16_samples_outputs/issue2956-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue2956-midend.p4 @@ -21,10 +21,8 @@ control ingress(inout Headers h) { @noWarn("unused") @name(".NoAction") action NoAction_1() { } @name("ingress.simple_assign") action simple_assign() { - h.eth_hdr.eth_type = 16w1; } @name("ingress.simple_assign") action simple_assign_1() { - h.eth_hdr.eth_type = 16w1; } @name("ingress.simple_assign") action simple_assign_2() { h.eth_hdr.eth_type = 16w1; diff --git a/testdata/p4_16_samples_outputs/issue2957-frontend.p4 b/testdata/p4_16_samples_outputs/issue2957-frontend.p4 index 6a1139184e..7bd281092b 100644 --- a/testdata/p4_16_samples_outputs/issue2957-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2957-frontend.p4 @@ -23,19 +23,16 @@ parser p(packet_in pkt, out Headers hdr) { @name("p.tmp_5") bit<8> tmp_4; @name("p.val_0") bit<3> val_1; @name("p.bound_0") bit<3> bound; - @name("p.hasReturned") bool hasReturned; @name("p.retval") bit<3> retval; @name("p.tmp") bit<3> tmp_5; state start { val_1 = 3w1; bound = 3w2; - hasReturned = false; if (val_1 < bound) { tmp_5 = val_1; } else { tmp_5 = bound; } - hasReturned = true; retval = tmp_5; tmp = retval; tmp_2 = tmp; diff --git a/testdata/p4_16_samples_outputs/issue3001-1-frontend.p4 b/testdata/p4_16_samples_outputs/issue3001-1-frontend.p4 index 4c11da82c5..348eda47a3 100644 --- a/testdata/p4_16_samples_outputs/issue3001-1-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue3001-1-frontend.p4 @@ -45,13 +45,10 @@ control ingressImpl(inout headers_t hdr, inout metadata_t meta, inout standard_m @name("ingressImpl.tmp_2") bool tmp_2; @name("ingressImpl.tmp_3") H[1] tmp_3; @name("ingressImpl.tmp_4") bool tmp_4; - @name("ingressImpl.hasReturned") bool hasReturned; @name("ingressImpl.retval") H retval; @name("ingressImpl.h") H h_0; - @name("ingressImpl.hasReturned_0") bool hasReturned_0; @name("ingressImpl.retval_0") U retval_0; @name("ingressImpl.u") U u_0; - @name("ingressImpl.hasReturned_1") bool hasReturned_1; @name("ingressImpl.retval_1") H[1] retval_1; @name("ingressImpl.s") H[1] s_0; apply { @@ -60,9 +57,7 @@ control ingressImpl(inout headers_t hdr, inout metadata_t meta, inout standard_m } else { log_msg("hdr.ethernet is invalid"); } - hasReturned = false; h_0.setInvalid(); - hasReturned = true; retval = h_0; tmp = retval; tmp_0 = tmp.isValid(); @@ -71,9 +66,7 @@ control ingressImpl(inout headers_t hdr, inout metadata_t meta, inout standard_m } else { log_msg("f() returned an invalid header"); } - hasReturned_0 = false; u_0.h.setInvalid(); - hasReturned_0 = true; retval_0 = u_0; tmp_1 = retval_0; tmp_2 = tmp_1.h.isValid(); @@ -82,9 +75,7 @@ control ingressImpl(inout headers_t hdr, inout metadata_t meta, inout standard_m } else { log_msg("g() returned a header_union with invalid member h"); } - hasReturned_1 = false; s_0[0].setInvalid(); - hasReturned_1 = true; retval_1 = s_0; tmp_3 = retval_1; tmp_4 = tmp_3[0].isValid(); diff --git a/testdata/p4_16_samples_outputs/issue3001-frontend.p4 b/testdata/p4_16_samples_outputs/issue3001-frontend.p4 index 3ae4e17da4..17e6b5f79b 100644 --- a/testdata/p4_16_samples_outputs/issue3001-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue3001-frontend.p4 @@ -3,14 +3,9 @@ header H { } control c() { - @name("c.hasReturned") bool hasReturned; - @name("c.retval") H retval; @name("c.h") H h_0; apply { - hasReturned = false; h_0.setInvalid(); - hasReturned = true; - retval = h_0; } } diff --git a/testdata/p4_16_samples_outputs/issue3051-frontend.p4 b/testdata/p4_16_samples_outputs/issue3051-frontend.p4 index 5ed77330ca..1f5827a298 100644 --- a/testdata/p4_16_samples_outputs/issue3051-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue3051-frontend.p4 @@ -1,9 +1,7 @@ control C(); package P(C a); control MyD() { - @optional @name("MyD.b_0") bool b_0; apply { - b_0 = !b_0; } } diff --git a/testdata/p4_16_samples_outputs/issue3051-midend.p4 b/testdata/p4_16_samples_outputs/issue3051-midend.p4 index 26468c05b2..1f5827a298 100644 --- a/testdata/p4_16_samples_outputs/issue3051-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue3051-midend.p4 @@ -1,18 +1,7 @@ control C(); package P(C a); control MyD() { - @optional @name("MyD.b_0") bool b_0; - @hidden action issue3051l6() { - b_0 = !b_0; - } - @hidden table tbl_issue3051l6 { - actions = { - issue3051l6(); - } - const default_action = issue3051l6(); - } apply { - tbl_issue3051l6.apply(); } } diff --git a/testdata/p4_16_samples_outputs/issue3051.p4-stderr b/testdata/p4_16_samples_outputs/issue3051.p4-stderr index e69de29bb2..894e5a1c0a 100644 --- a/testdata/p4_16_samples_outputs/issue3051.p4-stderr +++ b/testdata/p4_16_samples_outputs/issue3051.p4-stderr @@ -0,0 +1 @@ +[--Wwarn=uninitialized_use] warning: b_0 may be uninitialized diff --git a/testdata/p4_16_samples_outputs/issue3219-frontend.p4 b/testdata/p4_16_samples_outputs/issue3219-frontend.p4 index 78a739e907..2e0ec6099e 100644 --- a/testdata/p4_16_samples_outputs/issue3219-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue3219-frontend.p4 @@ -1,11 +1,8 @@ control c(out bit<4> result) { - @name("c.hasReturned") bool hasReturned; @name("c.retval") bit<4> retval; @name("c.t") bit<4> t_0; apply { - hasReturned = false; t_0 = (bit<4>)(int)1; - hasReturned = true; retval = t_0; result = retval; } diff --git a/testdata/p4_16_samples_outputs/issue323-frontend.p4 b/testdata/p4_16_samples_outputs/issue323-frontend.p4 index c6f310fd66..96336b1a30 100644 --- a/testdata/p4_16_samples_outputs/issue323-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue323-frontend.p4 @@ -42,11 +42,8 @@ control deparser(packet_out b, in Headers h) { } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.v") bit<32> v_0; @name("ingress.v") bit<32> v_2; @name("ingress.my_a") action my_a() { - v_0 = 32w0; - h.h.f = v_0; } @name("ingress.my_a") action my_a_1() { v_2 = 32w1; diff --git a/testdata/p4_16_samples_outputs/issue323-midend.p4 b/testdata/p4_16_samples_outputs/issue323-midend.p4 index 2e7233f742..51e213a19d 100644 --- a/testdata/p4_16_samples_outputs/issue323-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue323-midend.p4 @@ -43,7 +43,6 @@ control deparser(packet_out b, in Headers h) { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.my_a") action my_a() { - h.h.f = 32w0; } @name("ingress.my_a") action my_a_1() { h.h.f = 32w1; diff --git a/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-first.p4 b/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-first.p4 new file mode 100644 index 0000000000..b9e821fa62 --- /dev/null +++ b/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-first.p4 @@ -0,0 +1,12 @@ +void x() { +} +control c() { + apply { + x(); + } +} + +control _c(); +package top(_c _c); +top(c()) main; + diff --git a/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-frontend.p4 b/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-frontend.p4 new file mode 100644 index 0000000000..96d940e09b --- /dev/null +++ b/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-frontend.p4 @@ -0,0 +1,9 @@ +control c() { + apply { + } +} + +control _c(); +package top(_c _c); +top(c()) main; + diff --git a/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-midend.p4 b/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-midend.p4 new file mode 100644 index 0000000000..96d940e09b --- /dev/null +++ b/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-midend.p4 @@ -0,0 +1,9 @@ +control c() { + apply { + } +} + +control _c(); +package top(_c _c); +top(c()) main; + diff --git a/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse.p4 b/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse.p4 new file mode 100644 index 0000000000..b9e821fa62 --- /dev/null +++ b/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse.p4 @@ -0,0 +1,12 @@ +void x() { +} +control c() { + apply { + x(); + } +} + +control _c(); +package top(_c _c); +top(c()) main; + diff --git a/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse.p4-stderr b/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse.p4-stderr new file mode 100644 index 0000000000..e69de29bb2 diff --git a/testdata/p4_16_samples_outputs/issue3274-frontend.p4 b/testdata/p4_16_samples_outputs/issue3274-frontend.p4 index e24c967b4b..4d5f081c28 100644 --- a/testdata/p4_16_samples_outputs/issue3274-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue3274-frontend.p4 @@ -1,13 +1,10 @@ extern bit<32> f(in bit<32> x, out bit<16> y); control c(out bit<32> r) { @name("c.arg") bit<16> arg; - @name("c.hasReturned") bool hasReturned; @name("c.retval") bit<32> retval; @name("c.tmp") bit<32> tmp; apply { - hasReturned = false; tmp = f(x = 32w1, y = arg); - hasReturned = true; retval = tmp; r = retval; } diff --git a/testdata/p4_16_samples_outputs/issue3287-frontend.p4 b/testdata/p4_16_samples_outputs/issue3287-frontend.p4 index 6217c780e2..4633787a64 100644 --- a/testdata/p4_16_samples_outputs/issue3287-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue3287-frontend.p4 @@ -2,12 +2,9 @@ parser p(out bit<4> result) { @name("p.l_0") bit<4> l; - @name("p.hasReturned") bool hasReturned; @name("p.retval") bit<4> retval; state start { l = 4w1; - hasReturned = false; - hasReturned = true; retval = l << 6w1; result = retval; transition accept; diff --git a/testdata/p4_16_samples_outputs/issue3291-1-frontend.p4 b/testdata/p4_16_samples_outputs/issue3291-1-frontend.p4 index c3bb28821b..2625386400 100644 --- a/testdata/p4_16_samples_outputs/issue3291-1-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue3291-1-frontend.p4 @@ -11,24 +11,18 @@ struct h_1 { } control c(out bool x) { - @name("c.hasReturned_0") bool hasReturned; @name("c.retval_0") bool retval; @name("c.tmp") bool tmp; @name("c.a") h_0 a; @name("c.a_0") h_0 a_2; - @name("c.hasReturned") bool hasReturned_0; @name("c.retval") bool retval_0; @name("c.v") h_1 v_0; apply { - hasReturned = false; a = (h_0){f = 1w0}; a_2 = a; - hasReturned_0 = false; v_0.f = a_2; - hasReturned_0 = true; retval_0 = v_0.f == a_2; tmp = retval_0; - hasReturned = true; retval = tmp; x = retval; } diff --git a/testdata/p4_16_samples_outputs/issue3394-frontend.p4 b/testdata/p4_16_samples_outputs/issue3394-frontend.p4 index 7e445e7f94..91f6dc1f56 100644 --- a/testdata/p4_16_samples_outputs/issue3394-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue3394-frontend.p4 @@ -18,11 +18,6 @@ control MyIngress(inout header_t hdr, inout metadata meta, inout standard_metada @name("MyIngress.r") bit<8> r_0; apply { r_0 = 8w1; - if (r_0 == (bit<8>)3) { - r_0 = (bit<8>)3 + 8w1; - } else { - r_0 = (bit<8>)(1 + 3); - } } } diff --git a/testdata/p4_16_samples_outputs/issue420-frontend.p4 b/testdata/p4_16_samples_outputs/issue420-frontend.p4 index bb1d8989bd..9d00655278 100644 --- a/testdata/p4_16_samples_outputs/issue420-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue420-frontend.p4 @@ -33,7 +33,6 @@ parser parserI(packet_in pkt, out Parsed_packet hdr, inout mystruct1 meta, inout control cIngress(inout Parsed_packet hdr, inout mystruct1 meta, inout standard_metadata_t stdmeta) { @name("cIngress.hasReturned") bool hasReturned; - @name("cIngress.hasReturned_0") bool hasReturned_0; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @name("cIngress.foo") action foo(@name("bar") bit<16> bar) { @@ -56,9 +55,7 @@ control cIngress(inout Parsed_packet hdr, inout mystruct1 meta, inout standard_m default_action = NoAction_1(); } apply { - hasReturned_0 = false; tbl1_0.apply(); - hasReturned_0 = true; } } diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 index b6780d4639..aaa77e1949 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 @@ -16,7 +16,7 @@ struct parsed_packet_t { } struct local_metadata_t { - @field_list(0) + @field_list(0) row_t row; } @@ -56,3 +56,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 index b6780d4639..aaa77e1949 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 @@ -16,7 +16,7 @@ struct parsed_packet_t { } struct local_metadata_t { - @field_list(0) + @field_list(0) row_t row; } @@ -56,3 +56,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 index f7c0d8cc7a..26e29af0af 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 @@ -16,13 +16,13 @@ struct parsed_packet_t { } struct local_metadata_t { - @field_list(0) + @field_list(0) bit<1> _row_alt0_valid0; - @field_list(0) + @field_list(0) bit<7> _row_alt0_port1; - @field_list(0) + @field_list(0) bit<1> _row_alt1_valid2; - @field_list(0) + @field_list(0) bit<7> _row_alt1_port3; } @@ -72,3 +72,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2.p4 index 0a36f96579..e526772259 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2.p4 @@ -16,7 +16,7 @@ struct parsed_packet_t { } struct local_metadata_t { - @field_list(0) + @field_list(0) row_t row; } @@ -56,3 +56,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/m_psa-dpdk-non-zero-arg-default-action-08-frontend.p4 b/testdata/p4_16_samples_outputs/m_psa-dpdk-non-zero-arg-default-action-08-frontend.p4 index f0afb647b6..d4bf6cd634 100644 --- a/testdata/p4_16_samples_outputs/m_psa-dpdk-non-zero-arg-default-action-08-frontend.p4 +++ b/testdata/p4_16_samples_outputs/m_psa-dpdk-non-zero-arg-default-action-08-frontend.p4 @@ -36,7 +36,6 @@ control MyIngressControl(inout headers_t hdr, inout user_meta_data_t m, in psa_i tmp1_0 = hdr.ethernet.dst_addr; if (tmp1_0 == 48w0x1 && tmp2 == 32w0x2) { m.addr = hdr.ethernet.dst_addr; - hdr.ethernet.dst_addr = hdr.ethernet.src_addr; hdr.ethernet.src_addr = m.addr; } hdr.ethernet.dst_addr = tmp1_0; diff --git a/testdata/p4_16_samples_outputs/m_psa-dpdk-non-zero-arg-default-action-08-midend.p4 b/testdata/p4_16_samples_outputs/m_psa-dpdk-non-zero-arg-default-action-08-midend.p4 index e2d9ad150b..6279d67a77 100644 --- a/testdata/p4_16_samples_outputs/m_psa-dpdk-non-zero-arg-default-action-08-midend.p4 +++ b/testdata/p4_16_samples_outputs/m_psa-dpdk-non-zero-arg-default-action-08-midend.p4 @@ -26,20 +26,14 @@ parser MyIngressParser(packet_in pkt, out headers_t hdr, inout user_meta_data_t } control MyIngressControl(inout headers_t hdr, inout user_meta_data_t m, in psa_ingress_input_metadata_t c, inout psa_ingress_output_metadata_t d) { - @name("MyIngressControl.tmp1") bit<48> tmp1_0; - bool cond; @name("MyIngressControl.nonDefAct") action nonDefAct() { m.addr = hdr.ethernet.dst_addr; hdr.ethernet.dst_addr = hdr.ethernet.src_addr; hdr.ethernet.src_addr = m.addr; } @name("MyIngressControl.macswp") action macswp(@name("tmp2") bit<32> tmp2) { - tmp1_0 = hdr.ethernet.dst_addr; - cond = hdr.ethernet.dst_addr == 48w0x1 && tmp2 == 32w0x2; m.addr = (hdr.ethernet.dst_addr == 48w0x1 && tmp2 == 32w0x2 ? hdr.ethernet.dst_addr : m.addr); - hdr.ethernet.dst_addr = (hdr.ethernet.dst_addr == 48w0x1 && tmp2 == 32w0x2 ? hdr.ethernet.src_addr : hdr.ethernet.dst_addr); - hdr.ethernet.src_addr = (cond ? m.addr : hdr.ethernet.src_addr); - hdr.ethernet.dst_addr = tmp1_0; + hdr.ethernet.src_addr = (hdr.ethernet.dst_addr == 48w0x1 && tmp2 == 32w0x2 ? m.addr : hdr.ethernet.src_addr); } @name("MyIngressControl.stub") table stub_0 { actions = { diff --git a/testdata/p4_16_samples_outputs/mux-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/mux-bmv2-frontend.p4 index ddb540047d..bcdf32c722 100644 --- a/testdata/p4_16_samples_outputs/mux-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/mux-bmv2-frontend.p4 @@ -20,26 +20,11 @@ control Ing(inout Headers headers, inout Metadata meta, inout standard_metadata_ } control Eg(inout Headers hdrs, inout Metadata meta, inout standard_metadata_t standard_meta) { - @name("Eg._sub") bit<32> _sub_0; - @name("Eg.res") bit<64> res_0; - @name("Eg.tmp") bit<32> tmp; @name("Eg.p") bool p_0; - @name("Eg.val") bit<64> val_0; @name("Eg.update") action update() { p_0 = true; - val_0 = res_0; - _sub_0 = val_0[31:0]; - if (p_0) { - tmp = _sub_0; - } else { - tmp = 32w1; - } - _sub_0 = tmp; - val_0[31:0] = _sub_0; - res_0 = val_0; } apply { - res_0 = 64w0; update(); } } diff --git a/testdata/p4_16_samples_outputs/named-arg1-frontend.p4 b/testdata/p4_16_samples_outputs/named-arg1-frontend.p4 index 93325227cd..1228e6e701 100644 --- a/testdata/p4_16_samples_outputs/named-arg1-frontend.p4 +++ b/testdata/p4_16_samples_outputs/named-arg1-frontend.p4 @@ -18,43 +18,21 @@ parser par(out bool b) { control c(out bool b) { @name("c.xv") bit<16> xv_0; @name("c.x_1") bit<16> x_1; - @name("c.b_0") bool b_0; @name("c.x_2") bit<16> x_2; @name("c.b_1") bool b_1; - @name("c.bi") bit<16> bi_0; - @name("c.mb") bit<16> mb_0; - @name("c.bi") bit<16> bi_2; - @name("c.mb") bit<16> mb_2; @name("c.a") action a() { - bi_0 = 16w3; - mb_0 = -bi_0; - xv_0 = mb_0; } @name("c.a") action a_1() { - bi_2 = 16w0; - mb_2 = -bi_2; - xv_0 = mb_2; } apply { a(); a_1(); - x_1 = xv_0; - b_0 = x_1 == 16w0; - b = b_0; - xv_0 = x_1; - x_2 = xv_0; - b_1 = x_2 == 16w1; - xv_0 = x_2; - b = b_1; xv_0 = 16w1; x_1 = xv_0; - b_0 = x_1 == 16w0; xv_0 = x_1; - b = b_0; x_2 = xv_0; b_1 = x_2 == 16w1; b = b_1; - xv_0 = x_2; } } diff --git a/testdata/p4_16_samples_outputs/named-arg1-midend.p4 b/testdata/p4_16_samples_outputs/named-arg1-midend.p4 index 733b47cc64..4c7212ba06 100644 --- a/testdata/p4_16_samples_outputs/named-arg1-midend.p4 +++ b/testdata/p4_16_samples_outputs/named-arg1-midend.p4 @@ -8,21 +8,12 @@ parser par(out bool b) { } control c(out bool b) { - @name("c.xv") bit<16> xv_0; @name("c.a") action a() { - xv_0 = 16w65533; } @name("c.a") action a_1() { - xv_0 = 16w0; } - @hidden action namedarg1l40() { - b = xv_0 == 16w0; - b = xv_0 == 16w1; - xv_0 = 16w1; - xv_0 = 16w1; - b = false; + @hidden action act() { b = true; - xv_0 = 16w1; } @hidden table tbl_a { actions = { @@ -36,16 +27,16 @@ control c(out bool b) { } const default_action = a_1(); } - @hidden table tbl_namedarg1l40 { + @hidden table tbl_act { actions = { - namedarg1l40(); + act(); } - const default_action = namedarg1l40(); + const default_action = act(); } apply { tbl_a.apply(); tbl_a_0.apply(); - tbl_namedarg1l40.apply(); + tbl_act.apply(); } } diff --git a/testdata/p4_16_samples_outputs/next-def-use.p4-stderr b/testdata/p4_16_samples_outputs/next-def-use.p4-stderr index e69de29bb2..36c2a5f0c9 100644 --- a/testdata/p4_16_samples_outputs/next-def-use.p4-stderr +++ b/testdata/p4_16_samples_outputs/next-def-use.p4-stderr @@ -0,0 +1,3 @@ +next-def-use.p4(26): [--Wwarn=uninitialized] warning: hdr.hs.next: reading uninitialized value + hdr.hs.next = {8w0}; + ^^^^^^^^^^^ diff --git a/testdata/p4_16_samples_outputs/parser-arg-frontend.p4 b/testdata/p4_16_samples_outputs/parser-arg-frontend.p4 index 30138d7e19..70007734f5 100644 --- a/testdata/p4_16_samples_outputs/parser-arg-frontend.p4 +++ b/testdata/p4_16_samples_outputs/parser-arg-frontend.p4 @@ -15,3 +15,4 @@ parser Parser2_0() { } Package(Parser1_0(), Parser2_0()) main; + diff --git a/testdata/p4_16_samples_outputs/parser-conditional.p4-stderr b/testdata/p4_16_samples_outputs/parser-conditional.p4-stderr index 1a063a87f5..a5f89baf11 100644 --- a/testdata/p4_16_samples_outputs/parser-conditional.p4-stderr +++ b/testdata/p4_16_samples_outputs/parser-conditional.p4-stderr @@ -1 +1,7 @@ +parser-conditional.p4(19): [--Wwarn=uninitialized_out_param] warning: out parameter 'b' may be uninitialized when 'p' terminates +parser p(out bit<32> b) { + ^ +parser-conditional.p4(19) +parser p(out bit<32> b) { + ^ [--Wwarn=parser-transition] warning: SelectCase: unreachable case diff --git a/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test13-frontend.p4 b/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test13-frontend.p4 index da69fa77b9..2b67456916 100644 --- a/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test13-frontend.p4 +++ b/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test13-frontend.p4 @@ -28,7 +28,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout @name("ParserImpl.phdr") headers2 phdr_0; @name("ParserImpl.phdr") headers2 phdr_1; @name("ParserImpl.hdr_0") headers hdr_0; - @name("ParserImpl.inout_hdr_0") headers2 inout_hdr_0; @name("ParserImpl.p.shdr") headers2 p_shdr; state start { transition select(standard_metadata.ingress_port) { @@ -44,7 +43,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout hdr_0.h2.setInvalid(); hdr_0.h3.setInvalid(); hdr_0.h4.setInvalid(); - inout_hdr_0 = phdr_0; transition Subparser_start; } state Subparser_start { @@ -59,7 +57,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout state Subparser_sp1 { packet.extract(hdr_0.h3); packet.extract(p_shdr.h1); - inout_hdr_0.h1 = p_shdr.h1; transition p0_0; } state Subparser_sp2 { @@ -68,7 +65,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout } state p0_0 { hdr = hdr_0; - phdr_0 = inout_hdr_0; transition p2; } state p1 { @@ -78,7 +74,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout hdr_0.h2.setInvalid(); hdr_0.h3.setInvalid(); hdr_0.h4.setInvalid(); - inout_hdr_0 = phdr_1; transition Subparser_start_0; } state Subparser_start_0 { @@ -93,7 +88,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout state Subparser_sp1_0 { packet.extract(hdr_0.h3); packet.extract(p_shdr.h1); - inout_hdr_0.h1 = p_shdr.h1; transition p1_0; } state Subparser_sp2_0 { @@ -102,7 +96,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout } state p1_0 { hdr = hdr_0; - phdr_1 = inout_hdr_0; transition p2; } state p2 { diff --git a/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test13-midend.p4 b/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test13-midend.p4 index 02004ed6fc..145e6f8dd0 100644 --- a/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test13-midend.p4 +++ b/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test13-midend.p4 @@ -31,7 +31,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout data_t16 hdr_0_h2; data_t hdr_0_h3; data_t hdr_0_h4; - data_t inout_hdr_0_h1; data_t p_shdr_h1; state start { transition select(standard_metadata.ingress_port) { @@ -47,7 +46,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout hdr_0_h2.setInvalid(); hdr_0_h3.setInvalid(); hdr_0_h4.setInvalid(); - inout_hdr_0_h1 = phdr_0_h1; p_shdr_h1.setInvalid(); packet.extract(hdr_0_h1); transition select(hdr_0_h1.f) { @@ -59,7 +57,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout state Subparser_sp1 { packet.extract(hdr_0_h3); packet.extract(p_shdr_h1); - inout_hdr_0_h1 = p_shdr_h1; transition p0_0; } state Subparser_sp2 { @@ -71,7 +68,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout hdr.h2 = hdr_0_h2; hdr.h3 = hdr_0_h3; hdr.h4 = hdr_0_h4; - phdr_0_h1 = inout_hdr_0_h1; transition p2; } state p1 { @@ -81,7 +77,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout hdr_0_h2.setInvalid(); hdr_0_h3.setInvalid(); hdr_0_h4.setInvalid(); - inout_hdr_0_h1 = phdr_1_h1; p_shdr_h1.setInvalid(); packet.extract(hdr_0_h1); transition select(hdr_0_h1.f) { @@ -93,7 +88,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout state Subparser_sp1_0 { packet.extract(hdr_0_h3); packet.extract(p_shdr_h1); - inout_hdr_0_h1 = p_shdr_h1; transition p1_0; } state Subparser_sp2_0 { @@ -105,7 +99,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout hdr.h2 = hdr_0_h2; hdr.h3 = hdr_0_h3; hdr.h4 = hdr_0_h4; - phdr_1_h1 = inout_hdr_0_h1; transition p2; } state p2 { diff --git a/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test13.p4-stderr b/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test13.p4-stderr index e69de29bb2..c717a5ea2f 100644 --- a/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test13.p4-stderr +++ b/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test13.p4-stderr @@ -0,0 +1,12 @@ +[--Wwarn=uninitialized_use] warning: hdr_0 may not be completely initialized +[--Wwarn=uninitialized_use] warning: hdr_0 may not be completely initialized +[--Wwarn=uninitialized_use] warning: hdr_0 may not be completely initialized +[--Wwarn=uninitialized_use] warning: hdr_0 may not be completely initialized +[--Wwarn=uninitialized_use] warning: hdr_0 may not be completely initialized +[--Wwarn=uninitialized_use] warning: hdr_0 may not be completely initialized +[--Wwarn=uninitialized_use] warning: hdr_0 may not be completely initialized +[--Wwarn=uninitialized_use] warning: hdr_0 may not be completely initialized +[--Wwarn=uninitialized_use] warning: hdr_0 may not be completely initialized +[--Wwarn=uninitialized_use] warning: hdr_0 may not be completely initialized +[--Wwarn=uninitialized_use] warning: hdr_0 may not be completely initialized +[--Wwarn=uninitialized_use] warning: hdr_0 may not be completely initialized diff --git a/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test2-frontend.p4 b/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test2-frontend.p4 index cd31c5b83f..f7a25d616f 100644 --- a/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test2-frontend.p4 @@ -85,7 +85,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout state Subparser_sp1_0 { packet.extract(hdr.h3); packet.extract(p_shdr.h1); - phdr_0.h1 = p_shdr.h1; transition p1_0; } state Subparser_sp2_0 { diff --git a/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test2-midend.p4 b/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test2-midend.p4 index b04758712e..855e3ed1bf 100644 --- a/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test2-midend.p4 +++ b/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test2-midend.p4 @@ -79,7 +79,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout state Subparser_sp1_0 { packet.extract(hdr.h3); packet.extract(p_shdr_h1); - phdr_0_h1 = p_shdr_h1; transition p1_0; } state Subparser_sp2_0 { diff --git a/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test5-frontend.p4 b/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test5-frontend.p4 index b39e59e96d..de3daf60e2 100644 --- a/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test5-frontend.p4 +++ b/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test5-frontend.p4 @@ -55,7 +55,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout state Subparser_sp1 { packet.extract(hdr.h3); packet.extract(p_shdr.h1); - phdr_0.h1 = p_shdr.h1; transition p0_0; } state Subparser_sp2 { @@ -85,7 +84,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout state Subparser_sp1_0 { packet.extract(hdr.h3); packet.extract(p_shdr.h1); - phdr_0.h1 = p_shdr.h1; transition p1_0; } state Subparser_sp2_0 { diff --git a/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test5-midend.p4 b/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test5-midend.p4 index 9f278844ee..da03838ba4 100644 --- a/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test5-midend.p4 +++ b/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test5-midend.p4 @@ -52,7 +52,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout state Subparser_sp1 { packet.extract(hdr.h3); packet.extract(p_shdr_h1); - phdr_0_h1 = p_shdr_h1; transition p0_0; } state Subparser_sp2 { @@ -79,7 +78,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout state Subparser_sp1_0 { packet.extract(hdr.h3); packet.extract(p_shdr_h1); - phdr_0_h1 = p_shdr_h1; transition p1_0; } state Subparser_sp2_0 { diff --git a/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test6-frontend.p4 b/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test6-frontend.p4 index 27733734c2..c9f57fb189 100644 --- a/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test6-frontend.p4 +++ b/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test6-frontend.p4 @@ -55,7 +55,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout state Subparser_sp1 { packet.extract(hdr.h3); packet.extract(p_shdr.h1); - phdr_0.h1 = p_shdr.h1; transition p0_0; } state Subparser_sp2 { @@ -85,7 +84,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout state Subparser_sp1_0 { packet.extract(hdr.h3); packet.extract(p_shdr.h1); - phdr_0.h1 = p_shdr.h1; transition p1_0; } state Subparser_sp2_0 { diff --git a/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test6-midend.p4 b/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test6-midend.p4 index afa074cf6a..4822ce8fe6 100644 --- a/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test6-midend.p4 +++ b/testdata/p4_16_samples_outputs/parser-inline/parser-inline-test6-midend.p4 @@ -52,7 +52,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout state Subparser_sp1 { packet.extract(hdr.h3); packet.extract(p_shdr_h1); - phdr_0_h1 = p_shdr_h1; transition p0_0; } state Subparser_sp2 { @@ -79,7 +78,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout state Subparser_sp1_0 { packet.extract(hdr.h3); packet.extract(p_shdr_h1); - phdr_0_h1 = p_shdr_h1; transition p1_0; } state Subparser_sp2_0 { diff --git a/testdata/p4_16_samples_outputs/pna-dpdk-parser-state-err-frontend.p4 b/testdata/p4_16_samples_outputs/pna-dpdk-parser-state-err-frontend.p4 index 023745557c..84e8c9a401 100644 --- a/testdata/p4_16_samples_outputs/pna-dpdk-parser-state-err-frontend.p4 +++ b/testdata/p4_16_samples_outputs/pna-dpdk-parser-state-err-frontend.p4 @@ -80,15 +80,12 @@ control MainControlImpl(inout headers_t hdr, inout main_metadata_t user_meta, in @name("MainControlImpl.user_meta") main_metadata_t user_meta_2; @name("MainControlImpl.hdr_0") headers_t hdr_3; @name("MainControlImpl.user_meta_0") main_metadata_t user_meta_3; - @name("MainControlImpl.hasReturned") bool hasReturned; @name("MainControlImpl.retval") bit<1> retval; @name(".do_range_checks_0") action do_range_checks_1(@name("min1") bit<16> min1_2, @name("max1") bit<16> max1_2) { hdr_2 = hdr; user_meta_2 = user_meta; hdr_3 = hdr_2; user_meta_3 = user_meta_2; - hasReturned = false; - hasReturned = true; retval = (bit<1>)(min1_2 <= hdr_3.tcp.srcPort && hdr_3.tcp.srcPort <= max1_2); hdr_2 = hdr_3; user_meta_2 = user_meta_3; diff --git a/testdata/p4_16_samples_outputs/pna-example-tunnel-frontend.p4 b/testdata/p4_16_samples_outputs/pna-example-tunnel-frontend.p4 index 4505e71e17..3e209690ba 100644 --- a/testdata/p4_16_samples_outputs/pna-example-tunnel-frontend.p4 +++ b/testdata/p4_16_samples_outputs/pna-example-tunnel-frontend.p4 @@ -81,7 +81,6 @@ control PreControlImpl(in headers_t hdr, inout local_metadata_t meta, in pna_pre control main_control(inout headers_t hdr, inout local_metadata_t local_metadata, in pna_main_input_metadata_t istd, inout pna_main_output_metadata_t ostd) { @name("main_control.tmp") bool tmp; @name("main_control.istd_0") pna_main_input_metadata_t istd_1; - @name("main_control.hasReturned") bool hasReturned; @name("main_control.retval") bool retval; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @@ -118,8 +117,6 @@ control main_control(inout headers_t hdr, inout local_metadata_t local_metadata, } apply { istd_1 = istd; - hasReturned = false; - hasReturned = true; retval = istd_1.direction == PNA_Direction_t.NET_TO_HOST; tmp = retval; if (tmp) { diff --git a/testdata/p4_16_samples_outputs/pna-mux-dismantle-frontend.p4 b/testdata/p4_16_samples_outputs/pna-mux-dismantle-frontend.p4 index 90db0ed772..62db57958a 100644 --- a/testdata/p4_16_samples_outputs/pna-mux-dismantle-frontend.p4 +++ b/testdata/p4_16_samples_outputs/pna-mux-dismantle-frontend.p4 @@ -80,15 +80,12 @@ control MainControlImpl(inout headers_t hdr, inout main_metadata_t user_meta, in @name("MainControlImpl.user_meta") main_metadata_t user_meta_2; @name("MainControlImpl.hdr_0") headers_t hdr_3; @name("MainControlImpl.user_meta_0") main_metadata_t user_meta_3; - @name("MainControlImpl.hasReturned") bool hasReturned; @name("MainControlImpl.retval") bit<1> retval; @name(".do_range_checks_0") action do_range_checks_1(@name("min1") bit<16> min1_2, @name("max1") bit<16> max1_2) { hdr_2 = hdr; user_meta_2 = user_meta; hdr_3 = hdr_2; user_meta_3 = user_meta_2; - hasReturned = false; - hasReturned = true; retval = (bit<1>)(min1_2 <= hdr_3.tcp.srcPort && hdr_3.tcp.srcPort <= max1_2); hdr_2 = hdr_3; user_meta_2 = user_meta_3; diff --git a/testdata/p4_16_samples_outputs/pred-frontend.p4 b/testdata/p4_16_samples_outputs/pred-frontend.p4 index d8d0fa4bb7..40afd8eac9 100644 --- a/testdata/p4_16_samples_outputs/pred-frontend.p4 +++ b/testdata/p4_16_samples_outputs/pred-frontend.p4 @@ -5,9 +5,7 @@ control empty(); package top(empty e); control Ing() { - @name("Ing.b") bool b_0; @name("Ing.cond") action cond() { - b_0 = true; } apply { cond(); diff --git a/testdata/p4_16_samples_outputs/pred1-frontend.p4 b/testdata/p4_16_samples_outputs/pred1-frontend.p4 index 18a40911a5..40afd8eac9 100644 --- a/testdata/p4_16_samples_outputs/pred1-frontend.p4 +++ b/testdata/p4_16_samples_outputs/pred1-frontend.p4 @@ -5,13 +5,9 @@ control empty(); package top(empty e); control Ing() { - @name("Ing.b") bool b_0; - @name("Ing.a") bit<32> a_0; @name("Ing.cond") action cond() { - b_0 = true; } apply { - a_0 = 32w2; cond(); } } diff --git a/testdata/p4_16_samples_outputs/predication_issue_1-frontend.p4 b/testdata/p4_16_samples_outputs/predication_issue_1-frontend.p4 index 32f382a0bc..ff86b5fc73 100644 --- a/testdata/p4_16_samples_outputs/predication_issue_1-frontend.p4 +++ b/testdata/p4_16_samples_outputs/predication_issue_1-frontend.p4 @@ -28,15 +28,12 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.eth_t") bit<16> eth_t_0; @name("ingress.target_addr") bit<48> target_addr_0; @name("ingress.check_bool") bool check_bool_0; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bool retval; @name(".assign") action assign_0() { eth_t_0 = h.eth_hdr.eth_type; target_addr_0 = h.eth_hdr.dst_addr; check_bool_0 = true; if (check_bool_0) { - hasReturned = false; - hasReturned = true; retval = true; tmp = retval; if (tmp) { diff --git a/testdata/p4_16_samples_outputs/predication_issue_2-frontend.p4 b/testdata/p4_16_samples_outputs/predication_issue_2-frontend.p4 index e9cb92011c..3d6ad3303c 100644 --- a/testdata/p4_16_samples_outputs/predication_issue_2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/predication_issue_2-frontend.p4 @@ -40,7 +40,6 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.check") bool check_0; @name("ingress.val_0") bit<8> val_2; @name("ingress.bound_0") bit<8> bound; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<8> retval; @name("ingress.tmp") bit<8> tmp; @name("ingress.simple_action") action simple_action() { @@ -48,13 +47,11 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { if (check_0) { val_2 = h.idx.idx; bound = 8w1; - hasReturned = false; if (val_2 < bound) { tmp = val_2; } else { tmp = bound; } - hasReturned = true; retval = tmp; val = retval; h.h[val].a = 8w1; diff --git a/testdata/p4_16_samples_outputs/predication_issue_3-frontend.p4 b/testdata/p4_16_samples_outputs/predication_issue_3-frontend.p4 index 30298075b2..4d0acc6478 100644 --- a/testdata/p4_16_samples_outputs/predication_issue_3-frontend.p4 +++ b/testdata/p4_16_samples_outputs/predication_issue_3-frontend.p4 @@ -35,20 +35,17 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp_1") bit<3> tmp_0; @name("ingress.val_0") bit<3> val; @name("ingress.bound_0") bit<3> bound; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<3> retval; @name("ingress.tmp") bit<3> tmp_1; @name("ingress.perform_action") action perform_action() { if (bool_val_0) { val = 3w0; bound = 3w1; - hasReturned = false; if (val < bound) { tmp_1 = val; } else { tmp_1 = bound; } - hasReturned = true; retval = tmp_1; tmp = retval; tmp_0 = tmp; diff --git a/testdata/p4_16_samples_outputs/predication_issue_4-frontend.p4 b/testdata/p4_16_samples_outputs/predication_issue_4-frontend.p4 index 889bef102c..84ed06375e 100644 --- a/testdata/p4_16_samples_outputs/predication_issue_4-frontend.p4 +++ b/testdata/p4_16_samples_outputs/predication_issue_4-frontend.p4 @@ -36,20 +36,17 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp_1") bit<1> tmp_0; @name("ingress.val_0") bit<1> val; @name("ingress.bound_0") bit<1> bound; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<1> retval; @name("ingress.tmp") bit<1> tmp_1; @name("ingress.perform_action") action perform_action() { if (bool_val_0) { val = 1w0; bound = 1w1; - hasReturned = false; if (val < bound) { tmp_1 = val; } else { tmp_1 = bound; } - hasReturned = true; retval = tmp_1; tmp = retval; tmp_0 = tmp; diff --git a/testdata/p4_16_samples_outputs/predication_issue_4-midend.p4 b/testdata/p4_16_samples_outputs/predication_issue_4-midend.p4 index efb6616b09..22963fcb44 100644 --- a/testdata/p4_16_samples_outputs/predication_issue_4-midend.p4 +++ b/testdata/p4_16_samples_outputs/predication_issue_4-midend.p4 @@ -36,17 +36,14 @@ control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @name("ingress.tmp_1") bit<1> tmp_0; @name("ingress.val_0") bit<1> val; @name("ingress.bound_0") bit<1> bound; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<1> retval; @name("ingress.tmp") bit<1> tmp_1; bit<1> hsiVar; @name("ingress.perform_action") action perform_action() { val = (bool_val_0 ? 1w0 : val); bound = (bool_val_0 ? 1w1 : bound); - hasReturned = (bool_val_0 ? false : hasReturned); tmp_1 = (bool_val_0 ? (val < bound ? val : tmp_1) : tmp_1); tmp_1 = (bool_val_0 ? (val < bound ? val : bound) : tmp_1); - hasReturned = (bool_val_0 ? true : hasReturned); retval = (bool_val_0 ? tmp_1 : retval); tmp = (bool_val_0 ? retval : tmp); tmp_0 = (bool_val_0 ? tmp : tmp_0); diff --git a/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08-frontend.p4 b/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08-frontend.p4 index a41ff9617f..3ae9d9ec9b 100644 --- a/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08-frontend.p4 +++ b/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08-frontend.p4 @@ -38,7 +38,6 @@ control MyIngressControl(inout headers_t hdr, inout user_meta_data_t m, in psa_i tmp1_0 = m.flag; if (tmp1_0 == 32w0x1 && tmp2 == 32w0x2) { m.addr = hdr.ethernet.dst_addr; - hdr.ethernet.dst_addr = hdr.ethernet.src_addr; hdr.ethernet.src_addr = m.addr; } m.flag = tmp1_0; diff --git a/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08-midend.p4 b/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08-midend.p4 index cf1836c3f3..d65f2ee84c 100644 --- a/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08-midend.p4 +++ b/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08-midend.p4 @@ -34,9 +34,8 @@ control MyIngressControl(inout headers_t hdr, inout user_meta_data_t m, in psa_i hdr.ethernet.src_addr = m.addr; } @name("MyIngressControl.macswp") action macswp(@name("tmp2") bit<32> tmp2) { - m.addr = (m.flag == 32w0x1 && tmp2 == 32w0x2 ? hdr.ethernet.dst_addr : m.addr); - hdr.ethernet.dst_addr = (m.flag == 32w0x1 && tmp2 == 32w0x2 ? hdr.ethernet.src_addr : hdr.ethernet.dst_addr); - hdr.ethernet.src_addr = (m.flag == 32w0x1 && tmp2 == 32w0x2 ? m.addr : hdr.ethernet.src_addr); + m.addr = (hdr.ethernet.dst_addr == 48w0x1 && tmp2 == 32w0x2 ? hdr.ethernet.dst_addr : m.addr); + hdr.ethernet.src_addr = (hdr.ethernet.dst_addr == 48w0x1 && tmp2 == 32w0x2 ? m.addr : hdr.ethernet.src_addr); } @name("MyIngressControl.stub") table stub_0 { actions = { @@ -97,4 +96,3 @@ IngressPipeline(MyIngre EgressPipeline(MyEgressParser(), MyEgressControl(), MyEgressDeparser()) ep; PSA_Switch(ip, PacketReplicationEngine(), ep, BufferingQueueingEngine()) main; - diff --git a/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08.p4.spec b/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08.p4.spec index de5ed9dd0f..bb9c91c914 100644 --- a/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08.p4.spec @@ -36,7 +36,6 @@ struct user_meta_data_t { bit<8> psa_ingress_output_metadata_drop bit<32> psa_ingress_output_metadata_egress_port bit<48> local_metadata_addr - bit<32> local_metadata_flag } metadata instanceof user_meta_data_t @@ -48,11 +47,10 @@ action nonDefAct args none { } action macswp args instanceof macswp_arg_t { - jmpneq LABEL_END m.local_metadata_flag 0x1 + jmpneq LABEL_END h.ethernet.dst_addr 0x1 jmpneq LABEL_END t.tmp2 0x2 mov m.local_metadata_addr h.ethernet.dst_addr - mov h.ethernet.dst_addr h.ethernet.src_addr - mov h.ethernet.src_addr m.local_metadata_addr + mov h.ethernet.src_addr h.ethernet.dst_addr LABEL_END : return } @@ -61,7 +59,7 @@ table stub { macswp nonDefAct } - default_action macswp args tmp2 0x3 + default_action macswp args tmp2 0x3 size 0xf4240 } @@ -79,5 +77,3 @@ apply { tx m.psa_ingress_output_metadata_egress_port LABEL_DROP : drop } - - diff --git a/testdata/p4_16_samples_outputs/psa-example-digest-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/psa-example-digest-bmv2.p4-stderr index b35199606f..13cfbc6ec9 100644 --- a/testdata/p4_16_samples_outputs/psa-example-digest-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/psa-example-digest-bmv2.p4-stderr @@ -7,3 +7,15 @@ psa-example-digest-bmv2.p4(84): [--Wwarn=uninitialized_out_param] warning: out p psa-example-digest-bmv2.p4(82) parser CommonParser( ^^^^^^^^^^^^ +psa-example-digest-bmv2.p4(104): [--Wwarn=uninitialized_out_param] warning: out parameter 'parsed_hdr' may be uninitialized when 'IngressParserImpl' terminates + out headers parsed_hdr, + ^^^^^^^^^^ +psa-example-digest-bmv2.p4(103) +parser IngressParserImpl(packet_in buffer, + ^^^^^^^^^^^^^^^^^ +psa-example-digest-bmv2.p4(123): [--Wwarn=uninitialized_out_param] warning: out parameter 'parsed_hdr' may be uninitialized when 'EgressParserImpl' terminates + out headers parsed_hdr, + ^^^^^^^^^^ +psa-example-digest-bmv2.p4(122) +parser EgressParserImpl(packet_in buffer, + ^^^^^^^^^^^^^^^^ diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_1-frontend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_1-frontend.p4 index a1e0fa0227..693bbb0ae1 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_1-frontend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_1-frontend.p4 @@ -61,7 +61,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in @name("ingress.color_out") PSA_MeterColor_t color_out_0; @name("ingress.color_in") PSA_MeterColor_t color_in_0; @name("ingress.tmp") bit<32> tmp; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.version") bit<4> version_0; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @@ -104,7 +103,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in default_action = NoAction_1(); } apply { - hasReturned = false; color_in_0 = PSA_MeterColor_t.RED; if (user_meta.port_out == 32w1) { tbl_0.apply(); @@ -114,7 +112,7 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in user_meta.port_out = reg_0.read(12w1); test(); } else { - hasReturned = true; + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_1-midend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_1-midend.p4 index dc895900e2..31a4083eb6 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_1-midend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_1-midend.p4 @@ -120,6 +120,8 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in tbl_0.apply(); tbl_psaexampledpdkbytealignment_1l99.apply(); tbl_test.apply(); + } else { + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_2-frontend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_2-frontend.p4 index 95419f32c0..bc069e70f9 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_2-frontend.p4 @@ -60,7 +60,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in @name("ingress.color_out") PSA_MeterColor_t color_out_0; @name("ingress.color_in") PSA_MeterColor_t color_in_0; @name("ingress.tmp") bit<32> tmp; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.version") bit<4> version_0; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @@ -103,7 +102,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in default_action = NoAction_1(); } apply { - hasReturned = false; color_in_0 = PSA_MeterColor_t.RED; if (user_meta.port_out == 32w1) { tbl_0.apply(); @@ -113,7 +111,7 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in user_meta.port_out = reg_0.read(12w1); test(); } else { - hasReturned = true; + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_2-midend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_2-midend.p4 index bd8f43351d..980df3c396 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_2-midend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_2-midend.p4 @@ -119,6 +119,8 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in tbl_0.apply(); tbl_psaexampledpdkbytealignment_2l98.apply(); tbl_test.apply(); + } else { + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_3-frontend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_3-frontend.p4 index bb80fbfc75..933449ae5d 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_3-frontend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_3-frontend.p4 @@ -60,7 +60,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in @name("ingress.color_out") PSA_MeterColor_t color_out_0; @name("ingress.color_in") PSA_MeterColor_t color_in_0; @name("ingress.tmp") bit<32> tmp; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.version") bit<4> version_0; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @@ -105,7 +104,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in default_action = NoAction_1(); } apply { - hasReturned = false; color_in_0 = PSA_MeterColor_t.RED; if (user_meta.port_out == 32w1) { tbl_0.apply(); @@ -115,7 +113,7 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in user_meta.port_out = reg_0.read(12w1); test(); } else { - hasReturned = true; + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_3-midend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_3-midend.p4 index 52ccbb6d5b..21789fd348 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_3-midend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_3-midend.p4 @@ -121,6 +121,8 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in tbl_0.apply(); tbl_psaexampledpdkbytealignment_3l100.apply(); tbl_test.apply(); + } else { + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_5-frontend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_5-frontend.p4 index d1453cdcf9..27c96954aa 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_5-frontend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_5-frontend.p4 @@ -61,7 +61,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in @name("ingress.color_out") PSA_MeterColor_t color_out_0; @name("ingress.color_in") PSA_MeterColor_t color_in_0; @name("ingress.tmp") bit<32> tmp; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.version") bit<4> version_0; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @@ -104,7 +103,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in default_action = NoAction_1(); } apply { - hasReturned = false; color_in_0 = PSA_MeterColor_t.RED; if (user_meta.port_out == 32w1) { tbl_0.apply(); @@ -114,7 +112,7 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in user_meta.port_out = reg_0.read(12w1); test(); } else { - hasReturned = true; + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_5-midend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_5-midend.p4 index e9db118c83..004a29b778 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_5-midend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_5-midend.p4 @@ -120,6 +120,8 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in tbl_0.apply(); tbl_psaexampledpdkbytealignment_5l99.apply(); tbl_test.apply(); + } else { + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_6-frontend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_6-frontend.p4 index 58fad6b942..5b26b61877 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_6-frontend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_6-frontend.p4 @@ -68,7 +68,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in @name("ingress.color_out") PSA_MeterColor_t color_out_0; @name("ingress.color_in") PSA_MeterColor_t color_in_0; @name("ingress.tmp") bit<32> tmp; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.version") bit<4> version_0; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @@ -113,7 +112,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in default_action = NoAction_1(); } apply { - hasReturned = false; color_in_0 = PSA_MeterColor_t.RED; if (user_meta.port_out == 32w1) { tbl_0.apply(); @@ -123,7 +121,7 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in user_meta.port_out = reg_0.read(12w1); test(); } else { - hasReturned = true; + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_6-midend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_6-midend.p4 index f0243ccf6a..d706bdecb0 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_6-midend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_6-midend.p4 @@ -131,6 +131,8 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in tbl_0.apply(); tbl_psaexampledpdkbytealignment_6l109.apply(); tbl_test.apply(); + } else { + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_7-frontend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_7-frontend.p4 index 64896e0289..d2ebd2d20b 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_7-frontend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_7-frontend.p4 @@ -74,7 +74,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in @name("ingress.color_out") PSA_MeterColor_t color_out_0; @name("ingress.color_in") PSA_MeterColor_t color_in_0; @name("ingress.tmp") bit<32> tmp; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.version") bit<4> version_0; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @@ -121,7 +120,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in default_action = NoAction_1(); } apply { - hasReturned = false; color_in_0 = PSA_MeterColor_t.RED; if (user_meta.port_out == 32w1) { tbl_0.apply(); @@ -131,7 +129,7 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in user_meta.port_out = reg_0.read(12w1); test(); } else { - hasReturned = true; + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_7-midend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_7-midend.p4 index a6c0503604..06558b7000 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_7-midend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_7-midend.p4 @@ -142,6 +142,8 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in tbl_0.apply(); tbl_psaexampledpdkbytealignment_7l117.apply(); tbl_test.apply(); + } else { + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_8-frontend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_8-frontend.p4 index 52edb6cbf6..c22c940728 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_8-frontend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_8-frontend.p4 @@ -74,7 +74,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in @name("ingress.color_out") PSA_MeterColor_t color_out_0; @name("ingress.color_in") PSA_MeterColor_t color_in_0; @name("ingress.tmp") bit<32> tmp; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.version") bit<4> version_0; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @@ -121,7 +120,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in default_action = NoAction_1(); } apply { - hasReturned = false; color_in_0 = PSA_MeterColor_t.RED; if (user_meta.port_out == 32w1) { tbl_0.apply(); @@ -131,7 +129,7 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in user_meta.port_out = reg_0.read(12w1); test(); } else { - hasReturned = true; + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_8-midend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_8-midend.p4 index 26c560c62d..84693bf94a 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_8-midend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_8-midend.p4 @@ -142,6 +142,8 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in tbl_0.apply(); tbl_psaexampledpdkbytealignment_8l117.apply(); tbl_test.apply(); + } else { + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_9-frontend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_9-frontend.p4 index 06c398e98a..2f39a49a68 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_9-frontend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_9-frontend.p4 @@ -60,7 +60,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in @name("ingress.color_out") PSA_MeterColor_t color_out_0; @name("ingress.color_in") PSA_MeterColor_t color_in_0; @name("ingress.tmp") bit<32> tmp; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.version") bit<4> version_0; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @@ -105,7 +104,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in default_action = NoAction_1(); } apply { - hasReturned = false; color_in_0 = PSA_MeterColor_t.RED; if (user_meta.port_out == 32w1) { tbl_0.apply(); @@ -115,7 +113,7 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in user_meta.port_out = reg_0.read(12w1); test(); } else { - hasReturned = true; + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_9-midend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_9-midend.p4 index 72ea107475..4b39dbfde7 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_9-midend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-byte-alignment_9-midend.p4 @@ -121,6 +121,8 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in tbl_0.apply(); tbl_psaexampledpdkbytealignment_9l100.apply(); tbl_test.apply(); + } else { + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-externs-frontend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-externs-frontend.p4 index 63c4258209..556f58a2b7 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-externs-frontend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-externs-frontend.p4 @@ -54,7 +54,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in @name("ingress.color_out") PSA_MeterColor_t color_out_0; @name("ingress.color_in") PSA_MeterColor_t color_in_0; @name("ingress.tmp") bit<32> tmp; - @name("ingress.hasReturned") bool hasReturned; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @name("ingress.counter0") Counter, bit<12>>(32w1024, PSA_CounterType_t.PACKETS_AND_BYTES) counter0_0; @@ -83,7 +82,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in default_action = NoAction_1(); } apply { - hasReturned = false; color_in_0 = PSA_MeterColor_t.RED; if (user_meta.port_out == 32w1) { tbl_0.apply(); @@ -92,7 +90,7 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in counter2_0.count(12w1023, 32w64); user_meta.port_out = reg_0.read(12w1); } else { - hasReturned = true; + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-externs-midend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-externs-midend.p4 index 1111dd6a18..fdbbe01e01 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-externs-midend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-externs-midend.p4 @@ -100,6 +100,8 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in if (user_meta.port_out == 32w1) { tbl_0.apply(); tbl_psaexampledpdkexterns78.apply(); + } else { + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-meter-frontend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-meter-frontend.p4 index 6b053ca82f..4074d2f93d 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-meter-frontend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-meter-frontend.p4 @@ -54,7 +54,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in @name("ingress.color_out") PSA_MeterColor_t color_out_0; @name("ingress.color_in") PSA_MeterColor_t color_in_0; @name("ingress.tmp") bit<32> tmp; - @name("ingress.hasReturned") bool hasReturned; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @name("ingress.meter0") Meter>(32w1024, PSA_MeterType_t.BYTES) meter0_0; @@ -78,12 +77,11 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in default_action = NoAction_1(); } apply { - hasReturned = false; color_in_0 = PSA_MeterColor_t.RED; if (user_meta.port_out == 32w1) { tbl_0.apply(); } else { - hasReturned = true; + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-meter-midend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-meter-midend.p4 index 1fe4628ecc..e3e8d0d318 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-meter-midend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-meter-midend.p4 @@ -82,6 +82,8 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in tbl_psaexampledpdkmeter56.apply(); if (user_meta.port_out == 32w1) { tbl_0.apply(); + } else { + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-meter1-frontend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-meter1-frontend.p4 index ea0cd4931d..13ee5c9754 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-meter1-frontend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-meter1-frontend.p4 @@ -54,7 +54,6 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in @name("ingress.color_out") PSA_MeterColor_t color_out_0; @name("ingress.color_in") PSA_MeterColor_t color_in_0; @name("ingress.tmp") bit<32> tmp; - @name("ingress.hasReturned") bool hasReturned; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @name("ingress.meter0") Meter>(32w1024, PSA_MeterType_t.PACKETS) meter0_0; @@ -78,12 +77,11 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in default_action = NoAction_1(); } apply { - hasReturned = false; color_in_0 = PSA_MeterColor_t.RED; if (user_meta.port_out == 32w1) { tbl_0.apply(); } else { - hasReturned = true; + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-example-dpdk-meter1-midend.p4 b/testdata/p4_16_samples_outputs/psa-example-dpdk-meter1-midend.p4 index 14a5329c9d..62c0cf3635 100644 --- a/testdata/p4_16_samples_outputs/psa-example-dpdk-meter1-midend.p4 +++ b/testdata/p4_16_samples_outputs/psa-example-dpdk-meter1-midend.p4 @@ -82,6 +82,8 @@ control ingress(inout headers hdr, inout metadata_t user_meta, in psa_ingress_in tbl_psaexampledpdkmeter1l56.apply(); if (user_meta.port_out == 32w1) { tbl_0.apply(); + } else { + ; } } } diff --git a/testdata/p4_16_samples_outputs/psa-variable-index-frontend.p4 b/testdata/p4_16_samples_outputs/psa-variable-index-frontend.p4 index 7babcabaee..d92b691246 100644 --- a/testdata/p4_16_samples_outputs/psa-variable-index-frontend.p4 +++ b/testdata/p4_16_samples_outputs/psa-variable-index-frontend.p4 @@ -74,7 +74,6 @@ parser MyEP(packet_in buffer, out EMPTY_H a, inout EMPTY_M b, in psa_egress_pars control MyIC(inout header_t a, inout EMPTY_M b, in psa_ingress_input_metadata_t c, inout psa_ingress_output_metadata_t d) { @name("MyIC.tmp") bit<2> tmp; @name("MyIC.vid_0") bit<12> vid_1; - @name("MyIC.hasReturned") bool hasReturned; @name("MyIC.retval") bit<16> retval; @noWarn("unused") @name(".NoAction") action NoAction_1() { } @@ -94,8 +93,6 @@ control MyIC(inout header_t a, inout EMPTY_M b, in psa_ingress_input_metadata_t } else { tmp = b.depth; vid_1 = a.vlan_tag[tmp].vid; - hasReturned = false; - hasReturned = true; retval = (bit<16>)vid_1 + 16w5; b.ret = retval; tbl_0.apply(); diff --git a/testdata/p4_16_samples_outputs/simple-firewall_ubpf-frontend.p4 b/testdata/p4_16_samples_outputs/simple-firewall_ubpf-frontend.p4 index 7c23756d55..c50b481081 100644 --- a/testdata/p4_16_samples_outputs/simple-firewall_ubpf-frontend.p4 +++ b/testdata/p4_16_samples_outputs/simple-firewall_ubpf-frontend.p4 @@ -74,7 +74,6 @@ parser prs(packet_in p, out Headers_t headers, inout metadata meta, inout standa } control pipe(inout Headers_t headers, inout metadata meta, inout standard_metadata std_meta) { - @name("pipe.hasReturned") bool hasReturned; @name("pipe.s") bit<32> s_0; @name("pipe.s") bit<32> s_1; @name("pipe.s") bit<32> s_7; @@ -118,7 +117,6 @@ control pipe(inout Headers_t headers, inout metadata meta, inout standard_metada mark_to_drop(); } apply { - hasReturned = false; if (headers.tcp.isValid()) { if (headers.ipv4.srcAddr < headers.ipv4.dstAddr) { hash, bit<32>>>(meta.conn_id, HashAlgorithm.lookup3, { headers.ipv4.srcAddr, headers.ipv4.dstAddr }); @@ -138,7 +136,6 @@ control pipe(inout Headers_t headers, inout metadata meta, inout standard_metada } } else if (meta.connInfo.s == 32w2) { _drop(); - hasReturned = true; } else if (meta.connInfo.s == 32w3) { if (headers.tcp.fin == 1w1 && headers.tcp.ack == 1w1) { update_conn_info_1(); @@ -146,7 +143,6 @@ control pipe(inout Headers_t headers, inout metadata meta, inout standard_metada } } else if (meta.connInfo.s == 32w1) { _drop_1(); - hasReturned = true; } else if (meta.connInfo.s == 32w2) { if (headers.tcp.syn == 1w0 && headers.tcp.ack == 1w1) { update_conn_state_1(); diff --git a/testdata/p4_16_samples_outputs/simplify_method_calls-frontend.p4 b/testdata/p4_16_samples_outputs/simplify_method_calls-frontend.p4 index eaaa49d8b5..055fa830d4 100644 --- a/testdata/p4_16_samples_outputs/simplify_method_calls-frontend.p4 +++ b/testdata/p4_16_samples_outputs/simplify_method_calls-frontend.p4 @@ -8,50 +8,17 @@ control c(out bit<32> x, out bit<32> y) { @name("c.h") hdr h_0; @name("c.b") bool b_0; @name("c.a_0") bit<32> a_10; - @name("c.hasReturned_0") bool hasReturned; @name("c.retval_0") bit<32> retval; @name("c.a_1") bit<32> a_11; - @name("c.hasReturned") bool hasReturned_0; - @name("c.retval") bit<32> retval_0; - @name("c.a_2") bit<32> a_12; - @name("c.hasReturned_0") bool hasReturned_3; - @name("c.retval_0") bit<32> retval_3; - @name("c.a_3") bit<32> a_13; - @name("c.hasReturned") bool hasReturned_4; - @name("c.retval") bit<32> retval_4; - @name("c.a_4") bit<32> a_14; - @name("c.hasReturned") bool hasReturned_5; - @name("c.retval") bit<32> retval_5; - @name("c.a_5") bit<32> a_15; - @name("c.hasReturned_0") bool hasReturned_6; - @name("c.retval_0") bit<32> retval_6; - @name("c.a_6") bit<32> a_16; - @name("c.hasReturned_0") bool hasReturned_7; - @name("c.retval_0") bit<32> retval_7; @name("c.a_7") bit<32> a_17; - @name("c.hasReturned") bool hasReturned_8; - @name("c.retval") bit<32> retval_8; @name("c.a_8") bit<32> a_18; - @name("c.hasReturned_0") bool hasReturned_9; @name("c.retval_0") bit<32> retval_9; - @name("c.a_9") bit<32> a_19; - @name("c.hasReturned") bool hasReturned_10; - @name("c.retval") bit<32> retval_10; @name("c.simple_action") action simple_action() { a_10 = x; - hasReturned = false; - hasReturned = true; retval = a_10; y = retval; - hasReturned_0 = false; a_11 = 32w0; - hasReturned_0 = true; - retval_0 = a_11; x = a_11; - a_12 = x; - hasReturned_3 = false; - hasReturned_3 = true; - retval_3 = a_12; } apply { h_0.setValid(); @@ -60,41 +27,12 @@ control c(out bit<32> x, out bit<32> y) { h_0.setValid(); if (b_0) { x = h_0.a; - hasReturned_4 = false; - a_13 = 32w0; - hasReturned_4 = true; - retval_4 = a_13; - h_0.a = a_13; - hasReturned_5 = false; - a_14 = 32w0; - hasReturned_5 = true; - retval_5 = a_14; - h_0.a = a_14; - a_15 = h_0.a; - hasReturned_6 = false; - hasReturned_6 = true; - retval_6 = a_15; - a_16 = h_0.a; - hasReturned_7 = false; - hasReturned_7 = true; - retval_7 = a_16; } else { - hasReturned_8 = false; a_17 = 32w0; - hasReturned_8 = true; - retval_8 = a_17; h_0.a = a_17; - x = retval_8; a_18 = h_0.a; - hasReturned_9 = false; - hasReturned_9 = true; retval_9 = a_18; x = retval_9; - hasReturned_10 = false; - a_19 = 32w0; - hasReturned_10 = true; - retval_10 = a_19; - h_0.a = a_19; } simple_action(); } diff --git a/testdata/p4_16_samples_outputs/simplify_method_calls-midend.p4 b/testdata/p4_16_samples_outputs/simplify_method_calls-midend.p4 index 15a27b4677..a3eb082aec 100644 --- a/testdata/p4_16_samples_outputs/simplify_method_calls-midend.p4 +++ b/testdata/p4_16_samples_outputs/simplify_method_calls-midend.p4 @@ -13,14 +13,10 @@ control c(out bit<32> x, out bit<32> y) { } @hidden action simplify_method_calls51() { x = h_0.a; - h_0.a = 32w0; - h_0.a = 32w0; } - @hidden action simplify_method_calls60() { + @hidden action simplify_method_calls61() { h_0.a = 32w0; x = 32w0; - x = 32w0; - h_0.a = 32w0; } @hidden action simplify_method_calls37() { h_0.setValid(); @@ -40,11 +36,11 @@ control c(out bit<32> x, out bit<32> y) { } const default_action = simplify_method_calls51(); } - @hidden table tbl_simplify_method_calls60 { + @hidden table tbl_simplify_method_calls61 { actions = { - simplify_method_calls60(); + simplify_method_calls61(); } - const default_action = simplify_method_calls60(); + const default_action = simplify_method_calls61(); } @hidden table tbl_simple_action { actions = { @@ -57,7 +53,7 @@ control c(out bit<32> x, out bit<32> y) { if (b_0) { tbl_simplify_method_calls51.apply(); } else { - tbl_simplify_method_calls60.apply(); + tbl_simplify_method_calls61.apply(); } tbl_simple_action.apply(); } diff --git a/testdata/p4_16_samples_outputs/structArg-frontend.p4 b/testdata/p4_16_samples_outputs/structArg-frontend.p4 index be861d6187..d0c6fafa71 100644 --- a/testdata/p4_16_samples_outputs/structArg-frontend.p4 +++ b/testdata/p4_16_samples_outputs/structArg-frontend.p4 @@ -3,10 +3,7 @@ struct S { } control caller() { - @name("caller.data") S data_0; apply { - data_0.f = 32w0; - data_0.f = 32w0; } } diff --git a/testdata/p4_16_samples_outputs/struct_init-1-frontend.p4 b/testdata/p4_16_samples_outputs/struct_init-1-frontend.p4 index dd341b9117..deec280abd 100644 --- a/testdata/p4_16_samples_outputs/struct_init-1-frontend.p4 +++ b/testdata/p4_16_samples_outputs/struct_init-1-frontend.p4 @@ -16,7 +16,6 @@ control I(inout metadata_t meta) { if (meta.foo == (PortId_t){_v = 9w192}) { meta.foo._v = meta.foo._v + 9w1; h_0.setValid(); - h_0 = (H){b = 32w2}; } } } diff --git a/testdata/p4_16_samples_outputs/struct_init-1-midend.p4 b/testdata/p4_16_samples_outputs/struct_init-1-midend.p4 index 82f5b9ac27..0ff1f50ab5 100644 --- a/testdata/p4_16_samples_outputs/struct_init-1-midend.p4 +++ b/testdata/p4_16_samples_outputs/struct_init-1-midend.p4 @@ -15,7 +15,6 @@ control I(inout metadata_t meta) { @hidden action struct_init1l15() { meta._foo__v0 = meta._foo__v0 + 9w1; h_0.setValid(); - h_0.b = 32w2; } @hidden table tbl_struct_init1l15 { actions = { diff --git a/testdata/p4_16_samples_outputs/two-functions-frontend.p4 b/testdata/p4_16_samples_outputs/two-functions-frontend.p4 index 3899efd01d..3502bf1673 100644 --- a/testdata/p4_16_samples_outputs/two-functions-frontend.p4 +++ b/testdata/p4_16_samples_outputs/two-functions-frontend.p4 @@ -1,20 +1,10 @@ control c(inout bit<8> a) { @name("c.x_0") bit<8> x; - @name("c.hasReturned") bool hasReturned; - @name("c.retval") bit<8> retval; @name("c.x_1") bit<8> x_2; - @name("c.hasReturned_0") bool hasReturned_0; - @name("c.retval_0") bit<8> retval_0; apply { x = a; - hasReturned = false; - hasReturned = true; - retval = x; a = x; x_2 = a; - hasReturned_0 = false; - hasReturned_0 = true; - retval_0 = x_2; a = x_2; } } diff --git a/testdata/p4_16_samples_outputs/vss-example.p4-stderr b/testdata/p4_16_samples_outputs/vss-example.p4-stderr index 8c7214398c..8f3c5c9f2d 100644 --- a/testdata/p4_16_samples_outputs/vss-example.p4-stderr +++ b/testdata/p4_16_samples_outputs/vss-example.p4-stderr @@ -1,3 +1,18 @@ vss-example.p4(159): [--Wwarn=uninitialized_use] warning: nextHop may be uninitialized key = { nextHop : exact; } ^^^^^^^ +vss-example.p4(198): [--Wwarn=uninitialized_use] warning: outCtrl.outputPort may be uninitialized + if (outCtrl.outputPort == CPU_OUT_PORT) return; + ^^^^^^^^^^^^^^^^^^ +vss-example.p4(201): [--Wwarn=uninitialized_use] warning: outCtrl.outputPort may be uninitialized + if (outCtrl.outputPort == DROP_PORT) return; + ^^^^^^^^^^^^^^^^^^ +vss-example.p4(179): [--Wwarn=uninitialized_use] warning: outCtrl.outputPort may be uninitialized + key = { outCtrl.outputPort : exact; } + ^^^^^^^^^^^^^^^^^^ +vss-example.p4(95): [--Wwarn=uninitialized_out_param] warning: out parameter 'outCtrl' may be uninitialized when 'TopPipe' terminates + out OutControl outCtrl) { + ^^^^^^^ +vss-example.p4(92) +control TopPipe(inout Parsed_packet headers, + ^^^^^^^ From c9ed0aa2c18496e3ca953e6073202f56a72b299e Mon Sep 17 00:00:00 2001 From: Mihai Budiu Date: Fri, 21 Oct 2022 16:59:29 -0700 Subject: [PATCH 4/6] Run def-use analysis after inlining Signed-off-by: Mihai Budiu --- frontends/p4/simplifyDefUse.cpp | 4 ++++ .../gauntlet_hdr_in_value-bmv2-frontend.p4 | 3 --- .../global_action_after_exit-midend.p4 | 3 +-- .../issue1765-1-bmv2-midend.p4 | 15 ++++++++------- .../p4_16_samples_outputs/issue2648-frontend.p4 | 3 --- .../pna-example-header-union1-frontend.p4 | 1 - .../pna-example-header-union1-midend.p4 | 1 - .../pna-example-header-union1.p4-error | 2 ++ .../pna-example-header-union1.p4-stderr | 2 ++ .../pna-example-header-union1.p4.spec | 3 +-- ...pdk-non-zero-arg-default-action-08-frontend.p4 | 1 + ...-dpdk-non-zero-arg-default-action-08-midend.p4 | 6 ++++-- ...sa-dpdk-non-zero-arg-default-action-08.p4.spec | 10 +++++++--- 13 files changed, 30 insertions(+), 24 deletions(-) diff --git a/frontends/p4/simplifyDefUse.cpp b/frontends/p4/simplifyDefUse.cpp index 0a6ab940ea..7712388248 100644 --- a/frontends/p4/simplifyDefUse.cpp +++ b/frontends/p4/simplifyDefUse.cpp @@ -1443,6 +1443,10 @@ class FindUninitialized : public Inspector { return false; } + void postorder(const IR::StructExpression* expression) override { + otherExpression(expression); + } + void postorder(const IR::Operation_Unary* expression) override { otherExpression(expression); } diff --git a/testdata/p4_16_samples_outputs/gauntlet_hdr_in_value-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/gauntlet_hdr_in_value-bmv2-frontend.p4 index 521f1ce2f8..19d21be366 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_hdr_in_value-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/gauntlet_hdr_in_value-bmv2-frontend.p4 @@ -23,11 +23,8 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<16> retval; apply { - hasReturned = false; - hasReturned = true; retval = ((Headers){eth_hdr = (ethernet_t){dst_addr = 48w1,src_addr = 48w1,eth_type = 16w1}}).eth_hdr.eth_type + 16w1; h.eth_hdr.eth_type = retval; } diff --git a/testdata/p4_16_samples_outputs/global_action_after_exit-midend.p4 b/testdata/p4_16_samples_outputs/global_action_after_exit-midend.p4 index b2516f6ab0..d275d8f59e 100644 --- a/testdata/p4_16_samples_outputs/global_action_after_exit-midend.p4 +++ b/testdata/p4_16_samples_outputs/global_action_after_exit-midend.p4 @@ -23,8 +23,6 @@ parser p(packet_in pkt, out Headers hdr, inout Meta m, inout standard_metadata_t } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name(".do_action") action do_action_0() { - } apply { } } @@ -51,3 +49,4 @@ control deparser(packet_out pkt, in Headers h) { } V1Switch(p(), vrfy(), ingress(), egress(), update(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-midend.p4 index cda22a6459..c77ffd3881 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-midend.p4 @@ -93,15 +93,15 @@ struct headers { } struct metadata { - @field_list(0) - port_t ingress_port; - @field_list(0) - task_t task; - @field_list(0) + @field_list(0) + bit<9> ingress_port; + @field_list(0) + bit<16> task; + @field_list(0) bit<16> tcp_length; - @field_list(0) + @field_list(0) bit<32> cast_length; - @field_list(0) + @field_list(0) bit<1> do_cksum; } @@ -299,3 +299,4 @@ control MyEgress(inout headers hdr, inout metadata meta, inout standard_metadata } V1Switch(MyParser(), MyVerifyChecksum(), MyIngress(), MyEgress(), MyComputeChecksum(), MyDeparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue2648-frontend.p4 b/testdata/p4_16_samples_outputs/issue2648-frontend.p4 index 633ca1e23a..87f051fac0 100644 --- a/testdata/p4_16_samples_outputs/issue2648-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue2648-frontend.p4 @@ -24,11 +24,8 @@ parser p(packet_in pkt, out Headers hdr) { control ingress(inout Headers h) { @name("ingress.tmp") bit<8> tmp; @name("ingress.tmp_0") bit<8> tmp_0; - @name("ingress.hasReturned") bool hasReturned; @name("ingress.retval") bit<8> retval; apply { - hasReturned = false; - hasReturned = true; retval = ((H){a = 8w1}).a; tmp = retval; tmp_0 = tmp; diff --git a/testdata/p4_16_samples_outputs/pna-example-header-union1-frontend.p4 b/testdata/p4_16_samples_outputs/pna-example-header-union1-frontend.p4 index 3c20ddf241..d8986c1b7e 100644 --- a/testdata/p4_16_samples_outputs/pna-example-header-union1-frontend.p4 +++ b/testdata/p4_16_samples_outputs/pna-example-header-union1-frontend.p4 @@ -74,7 +74,6 @@ control ingress(inout headers hdr, inout metadata meta, in pna_main_input_metada if (hasReturned) { ; } else { - hasReturned = true; retval = false; } tmp = retval; diff --git a/testdata/p4_16_samples_outputs/pna-example-header-union1-midend.p4 b/testdata/p4_16_samples_outputs/pna-example-header-union1-midend.p4 index 4c027388af..76fe2d5fae 100644 --- a/testdata/p4_16_samples_outputs/pna-example-header-union1-midend.p4 +++ b/testdata/p4_16_samples_outputs/pna-example-header-union1-midend.p4 @@ -87,7 +87,6 @@ control ingress(inout headers hdr, inout metadata meta, in pna_main_input_metada hasReturned = false; } @hidden action pnaexampleheaderunion1l52() { - hasReturned = true; retval = false; } @hidden action pnaexampleheaderunion1l73() { diff --git a/testdata/p4_16_samples_outputs/pna-example-header-union1.p4-error b/testdata/p4_16_samples_outputs/pna-example-header-union1.p4-error index 5090e0eccd..d311fb208d 100644 --- a/testdata/p4_16_samples_outputs/pna-example-header-union1.p4-error +++ b/testdata/p4_16_samples_outputs/pna-example-header-union1.p4-error @@ -1 +1,3 @@ +[--Wwarn=uninitialized_use] warning: retval may be uninitialized +[--Wwarn=uninitialized_use] warning: retval may be uninitialized [--Wwarn=mismatch] warning: Mismatched header/metadata struct for key elements in table debug_hdr. Copying all match fields to metadata diff --git a/testdata/p4_16_samples_outputs/pna-example-header-union1.p4-stderr b/testdata/p4_16_samples_outputs/pna-example-header-union1.p4-stderr index e69de29bb2..063aefea8a 100644 --- a/testdata/p4_16_samples_outputs/pna-example-header-union1.p4-stderr +++ b/testdata/p4_16_samples_outputs/pna-example-header-union1.p4-stderr @@ -0,0 +1,2 @@ +[--Wwarn=uninitialized_use] warning: retval may be uninitialized +[--Wwarn=uninitialized_use] warning: retval may be uninitialized diff --git a/testdata/p4_16_samples_outputs/pna-example-header-union1.p4.spec b/testdata/p4_16_samples_outputs/pna-example-header-union1.p4.spec index a85cf7b2fa..47d04ba99b 100644 --- a/testdata/p4_16_samples_outputs/pna-example-header-union1.p4.spec +++ b/testdata/p4_16_samples_outputs/pna-example-header-union1.p4.spec @@ -77,8 +77,7 @@ apply { mov m.MainControlT_retval 1 LABEL_END_3 : jmpneq LABEL_FALSE_2 m.MainControlT_hasReturned 0x1 jmp LABEL_END_4 - LABEL_FALSE_2 : mov m.MainControlT_hasReturned 1 - mov m.MainControlT_retval 0 + LABEL_FALSE_2 : mov m.MainControlT_retval 0 LABEL_END_4 : jmpneq LABEL_END_5 m.MainControlT_retval 0x1 mov h.base.t 0x3 LABEL_END_5 : jmpnv LABEL_FALSE_4 h.u_short diff --git a/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08-frontend.p4 b/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08-frontend.p4 index 3ae9d9ec9b..a41ff9617f 100644 --- a/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08-frontend.p4 +++ b/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08-frontend.p4 @@ -38,6 +38,7 @@ control MyIngressControl(inout headers_t hdr, inout user_meta_data_t m, in psa_i tmp1_0 = m.flag; if (tmp1_0 == 32w0x1 && tmp2 == 32w0x2) { m.addr = hdr.ethernet.dst_addr; + hdr.ethernet.dst_addr = hdr.ethernet.src_addr; hdr.ethernet.src_addr = m.addr; } m.flag = tmp1_0; diff --git a/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08-midend.p4 b/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08-midend.p4 index d65f2ee84c..cf1836c3f3 100644 --- a/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08-midend.p4 +++ b/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08-midend.p4 @@ -34,8 +34,9 @@ control MyIngressControl(inout headers_t hdr, inout user_meta_data_t m, in psa_i hdr.ethernet.src_addr = m.addr; } @name("MyIngressControl.macswp") action macswp(@name("tmp2") bit<32> tmp2) { - m.addr = (hdr.ethernet.dst_addr == 48w0x1 && tmp2 == 32w0x2 ? hdr.ethernet.dst_addr : m.addr); - hdr.ethernet.src_addr = (hdr.ethernet.dst_addr == 48w0x1 && tmp2 == 32w0x2 ? m.addr : hdr.ethernet.src_addr); + m.addr = (m.flag == 32w0x1 && tmp2 == 32w0x2 ? hdr.ethernet.dst_addr : m.addr); + hdr.ethernet.dst_addr = (m.flag == 32w0x1 && tmp2 == 32w0x2 ? hdr.ethernet.src_addr : hdr.ethernet.dst_addr); + hdr.ethernet.src_addr = (m.flag == 32w0x1 && tmp2 == 32w0x2 ? m.addr : hdr.ethernet.src_addr); } @name("MyIngressControl.stub") table stub_0 { actions = { @@ -96,3 +97,4 @@ IngressPipeline(MyIngre EgressPipeline(MyEgressParser(), MyEgressControl(), MyEgressDeparser()) ep; PSA_Switch(ip, PacketReplicationEngine(), ep, BufferingQueueingEngine()) main; + diff --git a/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08.p4.spec b/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08.p4.spec index bb9c91c914..de5ed9dd0f 100644 --- a/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08.p4.spec +++ b/testdata/p4_16_samples_outputs/psa-dpdk-non-zero-arg-default-action-08.p4.spec @@ -36,6 +36,7 @@ struct user_meta_data_t { bit<8> psa_ingress_output_metadata_drop bit<32> psa_ingress_output_metadata_egress_port bit<48> local_metadata_addr + bit<32> local_metadata_flag } metadata instanceof user_meta_data_t @@ -47,10 +48,11 @@ action nonDefAct args none { } action macswp args instanceof macswp_arg_t { - jmpneq LABEL_END h.ethernet.dst_addr 0x1 + jmpneq LABEL_END m.local_metadata_flag 0x1 jmpneq LABEL_END t.tmp2 0x2 mov m.local_metadata_addr h.ethernet.dst_addr - mov h.ethernet.src_addr h.ethernet.dst_addr + mov h.ethernet.dst_addr h.ethernet.src_addr + mov h.ethernet.src_addr m.local_metadata_addr LABEL_END : return } @@ -59,7 +61,7 @@ table stub { macswp nonDefAct } - default_action macswp args tmp2 0x3 + default_action macswp args tmp2 0x3 size 0xf4240 } @@ -77,3 +79,5 @@ apply { tx m.psa_ingress_output_metadata_egress_port LABEL_DROP : drop } + + From 6179286e8d35426acc681b9e5f7e6d14400aa814 Mon Sep 17 00:00:00 2001 From: Mihai Budiu Date: Fri, 21 Oct 2022 17:03:46 -0700 Subject: [PATCH 5/6] Remove file added by mistake Signed-off-by: Mihai Budiu --- .../issue3274-1-FrontEnd_41_SimplifyDefUse.p4 | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 testdata/p4_16_samples/issue3274-1-FrontEnd_41_SimplifyDefUse.p4 diff --git a/testdata/p4_16_samples/issue3274-1-FrontEnd_41_SimplifyDefUse.p4 b/testdata/p4_16_samples/issue3274-1-FrontEnd_41_SimplifyDefUse.p4 deleted file mode 100644 index b9e821fa62..0000000000 --- a/testdata/p4_16_samples/issue3274-1-FrontEnd_41_SimplifyDefUse.p4 +++ /dev/null @@ -1,12 +0,0 @@ -void x() { -} -control c() { - apply { - x(); - } -} - -control _c(); -package top(_c _c); -top(c()) main; - From 3d5a95e491eff5538462d601f69677787917a67d Mon Sep 17 00:00:00 2001 From: Mihai Budiu Date: Sat, 22 Oct 2022 10:24:40 -0700 Subject: [PATCH 6/6] Remove files included by mistake Signed-off-by: Mihai Budiu --- .../testgen/targets/bmv2/test/BMV2Xfail.cmake | 1 - .../issue3274-1-FrontEnd_41_SimplifyDefUse-first.p4 | 12 ------------ ...ssue3274-1-FrontEnd_41_SimplifyDefUse-frontend.p4 | 9 --------- .../issue3274-1-FrontEnd_41_SimplifyDefUse-midend.p4 | 9 --------- .../issue3274-1-FrontEnd_41_SimplifyDefUse.p4 | 12 ------------ .../issue3274-1-FrontEnd_41_SimplifyDefUse.p4-stderr | 0 6 files changed, 43 deletions(-) delete mode 100644 testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-first.p4 delete mode 100644 testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-frontend.p4 delete mode 100644 testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-midend.p4 delete mode 100644 testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse.p4 delete mode 100644 testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse.p4-stderr diff --git a/backends/p4tools/testgen/targets/bmv2/test/BMV2Xfail.cmake b/backends/p4tools/testgen/targets/bmv2/test/BMV2Xfail.cmake index 9d615653c3..762bce5904 100755 --- a/backends/p4tools/testgen/targets/bmv2/test/BMV2Xfail.cmake +++ b/backends/p4tools/testgen/targets/bmv2/test/BMV2Xfail.cmake @@ -46,7 +46,6 @@ p4tools_add_xfail_reason( p4tools_add_xfail_reason( "testgen-p4c-bmv2" "bad json" - invalid-hdr-warnings4.p4 control-hs-index-test5.p4 ) diff --git a/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-first.p4 b/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-first.p4 deleted file mode 100644 index b9e821fa62..0000000000 --- a/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-first.p4 +++ /dev/null @@ -1,12 +0,0 @@ -void x() { -} -control c() { - apply { - x(); - } -} - -control _c(); -package top(_c _c); -top(c()) main; - diff --git a/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-frontend.p4 b/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-frontend.p4 deleted file mode 100644 index 96d940e09b..0000000000 --- a/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-frontend.p4 +++ /dev/null @@ -1,9 +0,0 @@ -control c() { - apply { - } -} - -control _c(); -package top(_c _c); -top(c()) main; - diff --git a/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-midend.p4 b/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-midend.p4 deleted file mode 100644 index 96d940e09b..0000000000 --- a/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse-midend.p4 +++ /dev/null @@ -1,9 +0,0 @@ -control c() { - apply { - } -} - -control _c(); -package top(_c _c); -top(c()) main; - diff --git a/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse.p4 b/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse.p4 deleted file mode 100644 index b9e821fa62..0000000000 --- a/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse.p4 +++ /dev/null @@ -1,12 +0,0 @@ -void x() { -} -control c() { - apply { - x(); - } -} - -control _c(); -package top(_c _c); -top(c()) main; - diff --git a/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse.p4-stderr b/testdata/p4_16_samples_outputs/issue3274-1-FrontEnd_41_SimplifyDefUse.p4-stderr deleted file mode 100644 index e69de29bb2..0000000000