Open lzhzero opened 1 year ago
If the bmv2 simulator supports wide masks the compiler should have no problem. The error message is not very good either.
@hanw, the blame claims you wrote this code. Can I assign this bug to you? Indeed, using static_cast is unsafe.
Hi, When we use
p4c-bm2-ss
to compile the attached program, sometime we get the following error depend on the Clang/gcc versions.This issue is only observed when we compile the
p4c-bm2-ss
binary with certain version of Clang/gcc. For other versions of Clang/gcc, the p4 program will just compile fine without any complains, I doubt it will run ok, but I haven't tested it.A little digging revealed that the LPM implementation is only using 64bit unsigned long. https://github.com/p4lang/p4c/blob/main/backends/bmv2/common/control.h#L488
Can 128bit LPM match be supported? Or at least the p4c-bm2-ss compiler should reject unsupported p4 programs no matter which Clang/gcc we use.
test_128.p4.txt