panic when compiling SHA
Simon Marlow
marlowsd at gmail.com
Wed Jan 8 10:42:03 UTC 2014
On 07/01/14 09:59, Ben Lippmeier wrote:
>
> On 06/01/2014, at 19:43 , Simon Peyton-Jones <simonpj at microsoft.com> wrote:
>
>> | Note that removing the flag isn't a "solution" to the underlying problem
>> | of the intermediate code being awful. Switching to the linear allocator
>> | just permits compilation of core code that was worse than before. Now it
>> | needs to spill more registers when compiling the same source code.
>>
>> In what way is the intermediate code awful?
>
> Because the error message from the register allocator tells us that
> there are over 1000 live variables at a particular point the assembly
> code, but the "biggest" SHA hashing algorithm (SHA-3) should only
> need to maintain 25 words of state (says Wikipedia).
Neither of the register allocators reuse spill slots for variables that
have disjoint live ranges, so the fact that we ran out of spill slots is
not necessarily indicative of terrible code (but I agree that it's a
strong hint).
Cheers,
Simon
More information about the ghc-devs
mailing list