Opened 6 years ago

Closed 5 years ago

#9329 closed bug (fixed)

GHC panics when Cmm-compiling `STK_CHK_GEN_N (8);`

Reported by: hvr Owned by: simonmar
Priority: normal Milestone: 7.8.4
Component: Compiler Version: 7.8.3
Keywords: Cc: simonmar
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


The following Cmm code snippet compiles fine

foo ()
  STK_CHK_GEN_N (((1)*8)); /* works */
  return (0);

The following one, however, only compiles with -O0, but panics with -O1 or more:

foo ()
  STK_CHK_GEN_N (8); /* panics */
  return (0);
ghc: panic! (the 'impossible' happened)
  (GHC version 7.8.3 for x86_64-unknown-linux):
    c1 foo [(c1,
             label: block{v c1}_info
             rep:StackRep [])]
    [(c0, {}), (c3, {})]
    foo() //  []
            { info_tbl: [(c1,
                          label: block{v c1}_info
                          rep:StackRep [])]
              stack_info: arg_space: 8 updfr_space: Just 8
          c0: R1 = 0;
              call (P64[Sp])(R1) args: 8, res: 0, upd: 8;

Please report this as a GHC bug:

Change History (5)

comment:1 Changed 5 years ago by simonmar

Owner: set to simonmar

comment:2 Changed 5 years ago by simonmar

Differential Rev(s):

comment:3 Changed 5 years ago by Simon Marlow <marlowsd@…>

In 2989ffdcb88ab24e8a4e8b3d0454497a0db2652c/ghc:

A panic in CmmBuildInfoTables.bundle shouldn't be a panic (#9329)

This code needs more comments, but I believe this is safe.  By
definition I can't have broken anything that was working by turning a
panic into a non-panic anyway.

Test Plan: validate

Reviewers: hvr, simonpj, austin

Subscribers: simonmar, relrod, ezyang, carter

Differential Revision:

GHC Trac Issues: #9329

comment:4 Changed 5 years ago by simonmar

Status: newmerge

comment:5 Changed 5 years ago by thoughtpolice

Resolution: fixed
Status: mergeclosed


Note: See TracTickets for help on using tickets.