Skip to content

Tofino backend: compiler bug when extracting varbit header #5138

@alexandergall

Description

@alexandergall

Versions:

  • open-p4studio: 0f2ad6
  • p4c: 660779

Compiling the attached P4 program (as GZIP since GitHub does not allow a .p4 extension) with open-p4studio produces the following error

debian@open-p4studio:~/open-p4studio/foo$ make
[  0%] Built target bf-p4c
[  0%] Built target driver
[100%] Generating bug/tofino/bf-rt.json
running find /home/debian/open-p4studio/foo/bug/tofino \( -name pipe* -or -name graphs -or -name logs -or -name visualization \) -type d -exec rm -rf {} +
running find /home/debian/open-p4studio/foo/bug/tofino \( -path *.json -or -path *.conf -or -path *.p4pp -or -path *.bfa -or -path *.log -or -path *.bin -or -path *.txt \) -type f -exec rm -f {} +
running cc -E -x assembler-with-cpp -D__TARGET_TOFINO__=1 -D__p4c__=1 -D__p4c_major__=9 -D__p4c_minor__=13               -D__p4c_patchlevel__=4 -D__p4c_version__=\"9.13.4\" -C -undef -nostdinc -x assembler-with-cpp -I /home/debian/open-p4studio/install/share/p4c/p4include -o /home/debian/open-p4studio/foo/bug/tofino/bug.p4pp /home/debian/open-p4studio/bug.p4
running /home/debian/open-p4studio/install/bin/p4c-barefoot --nocpp -D__TARGET_TOFINO__=1 -D__p4c__=1 -D__p4c_major__=9 -D__p4c_minor__=13               -D__p4c_patchlevel__=4 -D__p4c_version__=\"9.13.4\" -g -I /home/debian/open-p4studio/install/share/p4c/p4include --p4v=16 --target tofino --arch tna -o /home/debian/open-p4studio/foo/bug/tofino /home/debian/open-p4studio/foo/bug/tofino/bug.p4pp --create-graphs --verbose -Ttable_placement:3,table_summary:1,table_dependency_graph:3,table_dependency_summary:3,allocate_phv:1,allocator_base:3,trivial_allocator:5,greedy_allocator:5,alias:1,,allocate_clot:1,clot_info:1,split_parser_state:1,allocate_parser_match_register:1,allocate_parser_checksum:1,lower_parser:1,decaf*:1,characterize_parser.h:1,bridged_packing:1,ixbar_info:3 -Tstage_advance:3>/home/debian/open-p4studio/foo/bug/tofino/stage_adv.log --bf-rt-schema bug/tofino/bf-rt.json

1 error, 0 warnings generated.

In file: /home/debian/open-p4studio/pkgsrc/p4-compilers/p4c/ir/ir-inline.h:90
Compiler Bug: /home/debian/open-p4studio/pkgsrc/p4-compilers/p4c/ir/ir-inline.h:90: Null n

Internal compiler error. Please submit a bug report with your code.
make[2]: *** [CMakeFiles/bug-tofino.dir/build.make:80: bug/tofino/bf-rt.json] Error 4
make[1]: *** [CMakeFiles/Makefile2:127: CMakeFiles/bug-tofino.dir/all] Error 2
make: *** [Makefile:149: all] Error 2

The error only occurs when extracting a varbit header field.

The build was prepared with

debian@open-p4studio:~/open-p4studio/foo$ cmake ../p4studio/ -DCMAKE_INSTALL_PREFIX=$SDE_INSTALL -DCMAKE_MODULE_PATH=$SDE/cmake -DP4FLAGS="-v" -DP4_NAME=bug -DP4_PATH=/home/debian/open-p4studio/bug.p4
--
Using SDE: /home/debian/open-p4studio
--
Using SDE_INSTALL: /home/debian/open-p4studio/install
-- Python3 found: /usr/bin/python3.9
-- Python3 version: 3.9.2
-- Python3 include dir: /usr/include/python3.9
-- Python3 libraries: /usr/lib/x86_64-linux-gnu/libpython3.9.so
--
P4_LANG: p4-16
P4C: /home/debian/open-p4studio/install/bin/bf-p4c
P4C-GEN_BRFT-CONF: /home/debian/open-p4studio/install/bin/p4c-gen-bfrt-conf
P4C-MANIFEST-CONFIG: /home/debian/open-p4studio/install/bin/p4c-manifest-config
--
P4_PATH: /home/debian/open-p4studio/bug.p4
P4_NAME: bug
--
P4FLAGS: -v
-- Configuring done
-- Generating done
-- Build files have been written to: /home/debian/open-p4studio/foo

bug.p4.gz

Metadata

Metadata

Assignees

Labels

tofinoTopics related to the Tofino switch and back end.

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions