UNREG: fix emission of large Integer literals in C codegen
Summary: On amd64/UNREG build there is many failing tests trying to deal with 'Integer' types. Looking at 'integerConversions' test I've observed invalid C code generated by GHC. Cmm code CInt a = -1; (a == -1) yields 'False' with optimisations enabled via the following C code: StgWord64 a = (StgWord32)0xFFFFffffFFFFffffu; (a == 0xFFFFffffFFFFffffu) The patch fixes it by shrinking emitted literals to required sizes: StgWord64 a = (StgWord32)0xFFFFffffu; (a == 0xFFFFffffu) Thanks to Reid Barton for tracking down and fixing the issue. Signed-off-by:Sergei Trofimovich <slyfox@gentoo.org> Test Plan: validate on UNREG build (amd64, x86) Reviewers: simonmar, rwbarton, austin Subscribers: hvr, simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D173
Loading
-
mentioned in issue #8819 (closed)
-
mentioned in issue #10518 (closed)
-
mentioned in commit a5084557
-
mentioned in commit 53c6dcf7
-
mentioned in commit fa942e67
-
mentioned in commit 420b8ee8
Please register or sign in to comment