[GHC] #10518: unregisterised GHC generates incorrect 0xUL literals for certain onstants
#10518: unregisterised GHC generates incorrect 0xUL literals for certain onstants -------------------------------------+------------------------------------- Reporter: slyfox | Owner: slyfox Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- jakzale reports: 21:47:27 < int-e> Oh, nice. Yes, indeed pprHexVal (2^32) W32 (function from cmm/PprC.hs) would result in 0xU. 21:50:29 < jakzale> int-e: yes, truncInt takes module 2^32, then go returns empty string (I guess) Here comes the test: {{{ $ cat a.cmm foo() { bits64 a; a = 0x10000000000000000; // overflows 64 bits return (a); } $ inplace/bin/ghc-stage2 -c a.cmm /tmp/ghc8580_0/ghc_2.hc: In function 'foo': /tmp/ghc8580_0/ghc_2.hc:8:7: error: error: invalid suffix "xUL" on integer constant _c0 = 0xUL; ^ }}} I've broke it with commit:43f1b2ecd1960fa7377cf55a2b97c66059a701ef when introduced truncation that can generate more zeroes. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10518> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10518: unregisterised GHC generates incorrect 0xUL literals for certain onstants -------------------------------------+------------------------------------- Reporter: slyfox | Owner: slyfox Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by jakzale): * cc: jakzale (added) -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10518#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10518: unregisterised GHC generates incorrect 0xUL literals for certain onstants -------------------------------------+------------------------------------- Reporter: slyfox | Owner: slyfox Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Description changed by int-e: Old description:
jakzale reports: 21:47:27 < int-e> Oh, nice. Yes, indeed pprHexVal (2^32) W32 (function from cmm/PprC.hs) would result in 0xU. 21:50:29 < jakzale> int-e: yes, truncInt takes module 2^32, then go returns empty string (I guess)
Here comes the test: {{{ $ cat a.cmm
foo() { bits64 a; a = 0x10000000000000000; // overflows 64 bits return (a); }
$ inplace/bin/ghc-stage2 -c a.cmm /tmp/ghc8580_0/ghc_2.hc: In function 'foo':
/tmp/ghc8580_0/ghc_2.hc:8:7: error: error: invalid suffix "xUL" on integer constant _c0 = 0xUL; ^ }}} I've broke it with commit:43f1b2ecd1960fa7377cf55a2b97c66059a701ef when introduced truncation that can generate more zeroes.
New description: jakzale reports: 21:47:27 < int-e> Oh, nice. Yes, indeed pprHexVal (2^32^) W32 (function from cmm/PprC.hs) would result in 0xU. 21:50:29 < jakzale> int-e: yes, truncInt takes module 2^32^, then go returns empty string (I guess) Here comes the test: {{{ $ cat a.cmm foo() { bits64 a; a = 0x10000000000000000; // overflows 64 bits return (a); } $ inplace/bin/ghc-stage2 -c a.cmm /tmp/ghc8580_0/ghc_2.hc: In function 'foo': /tmp/ghc8580_0/ghc_2.hc:8:7: error: error: invalid suffix "xUL" on integer constant _c0 = 0xUL; ^ }}} I've broke it with commit:43f1b2ecd1960fa7377cf55a2b97c66059a701ef when introduced truncation that can generate more zeroes. -- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10518#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10518: unregisterised GHC generates incorrect 0xUL literals for certain onstants -------------------------------------+------------------------------------- Reporter: slyfox | Owner: slyfox Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D987 -------------------------------------+------------------------------------- Changes (by slyfox): * differential: => Phab:D987 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10518#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10518: unregisterised GHC generates incorrect 0xUL literals for certain onstants -------------------------------------+------------------------------------- Reporter: slyfox | Owner: slyfox Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D987 -------------------------------------+------------------------------------- Comment (by Sergei Trofimovich <siarheit@…>): In [changeset:"a5084557b0b30faf3f89386ee6ee5a308dae51b1/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="a5084557b0b30faf3f89386ee6ee5a308dae51b1" UNREG: fix pprHexVal to emit zeros (#10518) jakzale on #ghc reported a build failure when ported GHC on a new target. The code 'pprHexVal (2^32) W32' emits '0xU' which is invalid C. I've introduced bug in 43f1b2ecd1960fa7377cf55a2b97c66059a701ef when added literal truncation. That truncation is a new source of zeros. Signed-off-by: Sergei Trofimovich <siarheit@google.com> Test Plan: added test and tested on UNREG ghc Reviewers: austin Reviewed By: austin Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D987 GHC Trac Issues: #10518 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10518#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10518: unregisterised GHC generates incorrect 0xUL literals for certain onstants -------------------------------------+------------------------------------- Reporter: slyfox | Owner: slyfox Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | codeGen/should_compile/T10518 Related Tickets: | Blocking: | Differential Revisions: Phab:D987 -------------------------------------+------------------------------------- Changes (by slyfox): * testcase: => codeGen/should_compile/T10518 * failure: None/Unknown => Compile-time crash * milestone: => 7.10.2 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10518#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10518: unregisterised GHC generates incorrect 0xUL literals for certain onstants -------------------------------------+------------------------------------- Reporter: slyfox | Owner: slyfox Type: bug | Status: merge Priority: normal | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | codeGen/should_compile/T10518 Related Tickets: | Blocking: | Differential Revisions: Phab:D987 -------------------------------------+------------------------------------- Changes (by slyfox): * status: new => merge -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10518#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10518: unregisterised GHC generates incorrect 0xUL literals for certain onstants -------------------------------------+------------------------------------- Reporter: slyfox | Owner: slyfox Type: bug | Status: closed Priority: normal | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | codeGen/should_compile/T10518 Related Tickets: | Blocking: | Differential Revisions: Phab:D987 -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-7.10`. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10518#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC