[SAOC 2024] - Fix Segmentation fault when compiling druntime Weekly update #3

Steven Schveighoffer schveiguy at gmail.com
Sat Oct 12 02:33:21 UTC 2024


On Tuesday, 8 October 2024 at 13:04:40 UTC, RazvanN wrote:
> On Monday, 7 October 2024 at 18:37:31 UTC, Johan wrote:
>> It is a very invasive change to the compiler, that I feel 
>> should not be undertaken by someone with relatively little 
>> experience in D, let alone D compiler frontend development.
>> What are the safety checks to prevent _any_ actual change in 
>> compiler output?
>
> Hi Johan,
>
> If you are arguing that the test suite is not good enough to 
> catch breaking changes then that is an argument that can be 
> brought up for literally any change that is brought to the 
> compiler. In that regard I fail to see how this project is any 
> different from any other modification.
>
> With respect to the type of change: I have done literally tens 
> or even hundreds of such refactorings in the past 6-7 years. 
> From my experience: (1) 0 regressions or bugs were reported 
> linked to that sort of changes (apart from some C++ header 
> mismatches - but  I don't count those since those are not 
> actually related to the compiler behavior); (2) if you break 
> something while refactoring code - the test suite will catch it 
> (if the compiler does not beat you up to it).

I think Johan's point is that you are refactoring the compiler. 
If you are refactoring the compiler, the refactored compiler 
should produce the same output as the original compiler. A 
refactoring should not modify behavior (even to fix bugs), it 
should just make the code easier to use/write.

Do we have any way to test this? Possibly we should compare 
disassembly?

This would not be a CI task though - as it's impossible to pin 
down an "expected" disassembly for various projects.

-Steve


More information about the Digitalmars-d mailing list