Skip to content

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

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):
	bundle
    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
            }
        {offset
          c0: R1 = 0;
              call (P64[Sp])(R1) args: 8, res: 0, upd: 8;
        }
    }

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
Trac metadata
Trac field Value
Version 7.8.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC simonmar
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information