Ticket #1257 (closed bug: wontfix)

Opened 6 years ago

Last modified 20 months ago

Bytecode generator can't handle unboxed tuples

Reported by: igloo Owned by:
Priority: high Milestone: 7.4.1
Component: GHCi Version: 6.6
Keywords: Cc: michal.terepeta@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: dsrun014 Blocked By:
Blocking: Related Tickets:

Description

We need to implement unboxed tuple support in ghci.

For example, with:

f :: a -> b -> (# a, b #)
f x y = (# x, y #)

we get:

$ ghci -v0 -fglasgow-exts w.hs
ghc-6.6: panic! (the 'impossible' happened)
  (GHC version 6.6 for x86_64-unknown-linux):
        Bytecode generator can't handle unboxed tuples.  Possibly due
        to foreign import/export decls in source.  Workaround:
        compile this module to a .o file, then restart session.

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

Change History

  Changed 6 years ago by simonmar

  • owner set to simonmar

IIRC, it's not really feasible to do this in general. I'll investigate before 6.8 anyway.

  Changed 6 years ago by simonmar

  • owner simonmar deleted
  • milestone changed from 6.8 branch to _|_

This isn't going to happen, mainly because there are an infinite family of return conventions for unboxed tuples. We could cover more cases without too much difficulty, but the general case is really hard. Given that you can now do -fobject-code, it doesn't really seem worth it.

  Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

  Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

follow-up: ↓ 6   Changed 2 years ago by michalt

  • cc michal.terepeta@… added
  • failure set to None/Unknown
  • status changed from new to infoneeded

I've just tried to load a file with the above example and ghci just printed a nice error message:

[1 of 1] Compiling Test             ( Test.hs, interpreted )
Error: bytecode compiler can't handle unboxed tuples.
  Possibly due to foreign import/export decls in source.
  Workaround: use -fobject-code, or compile this module to .o separately.
>

So if it is difficult to implement and one can use -fobject-code then maybe we should just close the ticket?

in reply to: ↑ 5   Changed 2 years ago by simonmar

Replying to michalt:

So if it is difficult to implement and one can use -fobject-code then maybe we should just close the ticket?

That's what the _|_ milestone is for: bugs that either we can't fix, or aren't important enough to fix.

In this case, wouldn't it be better if GHC just automatically switched on -fobject-code?

  Changed 21 months ago by igloo

  • priority changed from normal to high
  • status changed from infoneeded to new
  • milestone changed from _|_ to 7.4.1

Let's either automatically enable -fobject-code, or add a suggestion to turn it on to the error message, and then close this ticket as wontfix.

  Changed 20 months ago by igloo

  • status changed from new to closed
  • resolution set to wontfix

Oh, the error already suggests -fobject-code.

I'm not a fan of magic like turning -fobject-code on automatically, so let's just mark this wontfix.

Note: See TracTickets for help on using tickets.