Conversation
|
#20985 is much easier to reproduce under low memory like today's Azure pipelines, which very well hints at hash collision as the root cause? |
|
As mentioned in the bug report, the failures are reproducible with cs_comphash() always returning 0, i.e. always causing collisions. Have you tested your change with that? |
|
This can pass the whole test suite with |
AFAIU only for expressions where the hashes happen to match, which is very unlikely and non-deterministic anyway.
Good to know.
Probably not worth the trouble. Do we have a test that CSE elimination works at all? |
No, I stubbed out all CSE code and tests are still green. |
|
Thanks for your pull request and interest in making D better, @limepoutine! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
|
* prevent invalid CSE on hash collision * Restore checks on Ecount
In
cgcs.d, assignment ops clobber CSE of a symbol, but weirdly do not clobber any larger common expressions referencing it. The checks to avoid false matches are a kludge. Instead, this PR now requires all leaf nodes to have already been merged by CSE before eliminating a larger expression. As a result, DMD's CSE is now immune to hash collision (in terms of correctness). This hopefully fixes #20985 (worked for a few hundred builds on my machine yet still unsure).On the downside, DMD's optimization is slightly weaker again. I think maybe very few people will care.