Don't complain about UNPACK in -fno-code.
ClosedPublic

Authored by ezyang on Nov 5 2017, 2:18 PM.

Details

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ezyang created this revision.Nov 5 2017, 2:18 PM
duog added a subscriber: duog.Nov 5 2017, 3:53 PM

I'm not sure this is right. When using -fno-code to quickly check code one has written, surely we DO want to see this warning.

bgamari requested changes to this revision.Nov 6 2017, 2:00 PM

I agree with @duog; it's not at all clear to me that we should warn in this case. If nothing else a comment explaining this is necessary.

This revision now requires changes to proceed.Nov 6 2017, 2:00 PM
austin resigned from this revision.Nov 9 2017, 5:43 PM

OK, in this case we need to flip this patch on its head. Today, if you compile with -O0, GHC will not warn about ill-placed UNPACK pragmas. We should make this be the case. And then I need to add some more logic to have this warning be suppressed when Backpack is being used,.

ezyang updated this revision to Diff 14716.Nov 16 2017, 9:21 PM

Tweak logic

duog added a comment.Nov 17 2017, 11:05 AM

This seems great to me, but then I don't understand why -O0 suppressed this originally.

Maybe this deserves a mention in the release notes/migration guide, as it could cause breakage for code compiled with -O0 -Werror.

This seems great to me, but then I don't understand why -O0 suppressed this originally.

Yah, actually, this patch doesn't validate. The problem is that when optimization is turned off, this branch triggers, because we just don't bother actually figuring out if the unpack will work or not, we unconditionally decide not to.

ezyang updated this revision to Diff 14812.Nov 24 2017, 11:20 PM

make this actually work

bgamari accepted this revision.Nov 27 2017, 8:26 AM

Sounds reasonable to me.

This revision is now accepted and ready to land.Nov 27 2017, 8:26 AM
This revision was automatically updated to reflect the committed changes.