[GHC] #11076: Demand information of foreign calls is wrong
#11076: Demand information of foreign calls is wrong -------------------------------------+------------------------------------- Reporter: luite | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Foreign calls of all types (including prim calls) use `mkFCallId` to create a fresh `Id` for each one. This Id claims to be strict in all arguments, which is not correct for foreign calls that allow lifted types to be passed. This also causes some trouble for GHCJS. I hope to get a fix in 7.10.3. Can we leave the strictness sig out entirely perhaps? Most arguments would be trivially strict since they're unboxed. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11076> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11076: Demand information of foreign calls is wrong -------------------------------------+------------------------------------- Reporter: luite | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by luite): * Attachment "forDmd_prim.cmm" added. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11076> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11076: Demand information of foreign calls is wrong -------------------------------------+------------------------------------- Reporter: luite | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by luite): * Attachment "forDmd.hs" added. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11076> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11076: Demand information of foreign calls is wrong -------------------------------------+------------------------------------- Reporter: luite | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by luite): * Attachment "ForDmdA.hs" added. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11076> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11076: Demand information of foreign calls is wrong -------------------------------------+------------------------------------- Reporter: luite | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by luite): related GHCJS ticket: https://github.com/ghcjs/ghcjs/issues/443 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11076#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11076: Demand information of foreign calls is wrong -------------------------------------+------------------------------------- Reporter: luite | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by luite): * milestone: => 7.10.3 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11076#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11076: Demand information of foreign calls is wrong -------------------------------------+------------------------------------- Reporter: luite | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by luite): Changing the argument demand type from `evalDmd` to `topDmd` (in `MkId.mkFCallId`) fixes the problem for this test case and for GHCJS, and other than a minor (and I think harmless) change in one of the `stranal` test cases doesn't cause any validate issues. I just want to make sure, is this a sane thing to do? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11076#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11076: Demand information of foreign calls is wrong -------------------------------------+------------------------------------- Reporter: luite | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Luite, yes, I think that seems sane. Where precisely do you make this change? Please add a clear Note to explain, referencing the ticket and giving an example. It's late in the day for 7.10.3, but I'll leave that to Ben and Austin. Simon -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11076#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11076: Demand information of foreign calls is wrong -------------------------------------+------------------------------------- Reporter: luite | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1407 Wiki Page: | -------------------------------------+------------------------------------- Changes (by luite): * differential: => Phab:D1407 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11076#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11076: Demand information of foreign calls is wrong -------------------------------------+------------------------------------- Reporter: luite | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1464 Wiki Page: | -------------------------------------+------------------------------------- Changes (by luite): * differential: Phab:D1407 => Phab:D1464 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11076#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11076: Demand information of foreign calls is wrong -------------------------------------+------------------------------------- Reporter: luite | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1464 Wiki Page: | -------------------------------------+------------------------------------- Comment (by luite): See diff. I'll update the expected test results once my validate run finishes. Should I also add the attached test case to the testsuite? If it's too late for 7.10.3 then feel free to remove the milestone and just merge in HEAD, I'll try to find a workaround then. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11076#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11076: Demand information of foreign calls is wrong -------------------------------------+------------------------------------- Reporter: luite | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1464 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): I think we can swing 7.10.3. Can you add your testcase to the patch, however? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11076#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11076: Demand information of foreign calls is wrong -------------------------------------+------------------------------------- Reporter: luite | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1464 Wiki Page: | -------------------------------------+------------------------------------- Comment (by luite): I've added the test case from this ticket. Does the change in strictness signature for T8598 look ok? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11076#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11076: Demand information of foreign calls is wrong -------------------------------------+------------------------------------- Reporter: luite | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1464 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"e090f1bc14b5bf1deeef1c753c1145c162c0d27f/ghc" e090f1b/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="e090f1bc14b5bf1deeef1c753c1145c162c0d27f" Change demand information for foreign calls Foreign calls may not be strict for lifted arguments. Fixes Trac #11076. Test Plan: ./validate Reviewers: simonpj, bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1464 GHC Trac Issues: #11076 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11076#comment:10> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11076: Demand information of foreign calls is wrong -------------------------------------+------------------------------------- Reporter: luite | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1464 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11076#comment:11> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11076: Demand information of foreign calls is wrong -------------------------------------+------------------------------------- Reporter: luite | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1464 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"494907f89d129370ec5ab178cec860a64b456ac8/ghc" 494907f/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="494907f89d129370ec5ab178cec860a64b456ac8" testsuite: Add test for #11076 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11076#comment:12> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC