[clang] Compiler bug when compiling a ujson_derive file
Nobody has claimed this yet.
- Dominant language
- SystemVerilog
- Stars
- 3.6k
- Forks
- 1.1k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 141
Description
Description
While working on https://github.com/lowRISC/opentitan/pull/27887, I identified what looks like a compiler bug in the clang that we used for the RISCV-32 toolchain. To reproduce, apply the following diff:
diff --git i/sw/device/tests/penetrationtests/json/cryptolib_fi_asym_commands.h w/sw/device/tests/penetrationtests/json/cryptolib_fi_asym_commands.h
index 303a338c12..46c7d6e43e 100644
--- i/sw/device/tests/penetrationtests/json/cryptolib_fi_asym_commands.h
+++ w/sw/device/tests/penetrationtests/json/cryptolib_fi_asym_commands.h
@@ -9,7 +9,7 @@
extern "C" {
#endif
+#define MODULE_ID MAKE_MODULE_ID('j', 'f', 'a')
#define RSA_CMD_MAX_MESSAGE_BYTES 512
#define RSA_CMD_MAX_N_BYTES 512
and run
./bazelisk.sh build --define bitstream=skip //sw/device/tests/penetrationtests/json:cryptolib_fi_asym_commands --define DISABLE_VERILATOR_BUILD=true --config=riscv32
Compilation does not ever finish but the compiler quickly uses gigabytes of memory.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Apply the diff to sw/device/tests/penetrationtests/json/cryptolib_fi_asym_commands.h, then run the provided bazelisk.sh build command with the riscv32 configuration. Start by reproducing the non-terminating compilation and excessive memory use; done means the compiler behavior is understood and the build no longer exhibits that failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system, compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100