[GHC] #8619: Support anonymous string literals in C-- (OR) give better ASSERT failure messages in C--

#8619: Support anonymous string literals in C-- (OR) give better ASSERT failure messages in C-- ------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.7 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: Other Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- So if I say "foobar" in C--, it turns into: {{{ section "rodata" { fresh_name : bits8[] "foobar\0"; } }}} This would let us fix the ASSERT macro in Cmm.h to also get the filename. Requires parser changes. Alternatively, we can redefine the ASSERT macro per C-- file to have a hardcoded filename with some preprocessor trickery. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8619 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8619: Support anonymous string literals in C-- (OR) give better ASSERT failure messages in C-- -------------------------------------+------------------------------------ Reporter: ezyang | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Other | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by carter): This would also pave the way to supporting static data structures more generally right? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8619#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8619: Support anonymous string literals in C-- (OR) give better ASSERT failure messages in C-- -------------------------------------+------------------------------------ Reporter: ezyang | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Other | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by ezyang): No, you can already specify data to be placed in a read-only data section; the only reason really to want string literals is convenience and macro situations like ASSERT. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8619#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8619: Support anonymous string literals in C-- (OR) give better ASSERT failure messages in C-- -------------------------------------+------------------------------------- Reporter: ezyang | Owner: (none) Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by osa1): * cc: osa1 (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8619#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8619: Support anonymous string literals in C-- (OR) give better ASSERT failure messages in C-- -------------------------------------+------------------------------------- Reporter: ezyang | Owner: (none) Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): This would be really helpful when debugging. Currently we have to use NULL for the location in `assertFail`, causing error messages like `ghc-stage2: internal error: ASSERTION FAILED: file (null), line 1302`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8619#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8619: Support anonymous string literals in C-- (OR) give better ASSERT failure messages in C-- -------------------------------------+------------------------------------- Reporter: ezyang | Owner: (none) Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): It seems like we currently support string literals in Cmm. I have a patch but don't have time to validate it now, I'll submit it later. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8619#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8619: Support anonymous string literals in C-- (OR) give better ASSERT failure messages in C-- -------------------------------------+------------------------------------- Reporter: ezyang | Owner: (none) Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4862 Wiki Page: | -------------------------------------+------------------------------------- Changes (by osa1): * differential: => Phab:D4862 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8619#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8619: Support anonymous string literals in C-- (OR) give better ASSERT failure messages in C-- -------------------------------------+------------------------------------- Reporter: ezyang | Owner: (none) Type: feature request | Status: patch Priority: low | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4862 Wiki Page: | -------------------------------------+------------------------------------- Changes (by osa1): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8619#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8619: Support anonymous string literals in C-- (OR) give better ASSERT failure
messages in C--
-------------------------------------+-------------------------------------
Reporter: ezyang | Owner: (none)
Type: feature request | Status: patch
Priority: low | Milestone:
Component: Compiler | Version: 7.7
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Other | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4862
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#8619: Support anonymous string literals in C-- (OR) give better ASSERT failure messages in C-- -------------------------------------+------------------------------------- Reporter: ezyang | Owner: (none) Type: feature request | Status: closed Priority: low | Milestone: Component: Compiler | Version: 7.7 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4862 Wiki Page: | -------------------------------------+------------------------------------- Changes (by osa1): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8619#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC