Opened 8 months ago

Closed 7 months 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 Revisions: https://phabricator.haskell.org/D105

Description

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

Change History (5)

comment:1 Changed 8 months ago by simonmar

  • Owner set to simonmar

comment:2 Changed 7 months ago by simonmar

  • Differential Revisions set to https://phabricator.haskell.org/D105
  • Milestone changed from 7.10.1 to 7.8.4

comment:3 Changed 7 months ago by Simon Marlow <marlowsd@…>

In 2989ffdcb88ab24e8a4e8b3d0454497a0db2652c/ghc:

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

Summary:
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: https://phabricator.haskell.org/D105

GHC Trac Issues: #9329

comment:4 Changed 7 months ago by simonmar

  • Status changed from new to merge

comment:5 Changed 7 months ago by thoughtpolice

  • Resolution set to fixed
  • Status changed from merge to closed

Merged.

Note: See TracTickets for help on using tickets.