Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Duplicated expression when compiling with -g #6805
Original bug ID: 6805
When compiling this example extracted from frama-c, some expression
This may no trigger any real bug with the current compiler, but the
Steps to reproduce
the outputs contains this:
Comment author: @alainfrisch
Bumping priority, as this sounds quite serious.
The bug is probably in switch.ml. It gets called from matching.ml to create a switch on integers 3, 5, 6, 7 and it produces a switch on arg-3 with cases 0, 1, 2, 3, 4 (instead of 0, 2, 3, 4).
I'm not familiar with this piece of code, but my analysis is the following:
One could perhaps fix that by detecting in Switch.make_switch the presence of holes, and add one more "dummy" action for them. I've attached a tentative fix, but it would be good if someone more aware of this piece of code (Luc?) could look at it...
Comment author: @maranget
Thank you for reporting and for the analysis.
In the described situation: switch emitted, some holes (missing constructors),
All this is rather complex and not that robust. At least the PR is fixed.