Opened 7 years ago

Last modified 4 years ago

#7287 new bug

Primops in RULES generate warnings

Reported by: rl Owned by:
Priority: normal Milestone: 7.6.2
Component: Compiler Version: 7.7
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect warning at compile-time Test Case: simplCore/should_compile/T7287
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


import GHC.Prim


"int2Word#/word2Int#" forall x. int2Word# (word2Int# x) = x


produces the following warning:

    Rule "int2Word#/word2Int#" may never fire
      because `int2Word#' might inline first
    Probable fix: add an INLINE[n] or NOINLINE[n] pragma on `int2Word#'

Change History (7)

comment:1 Changed 7 years ago by simonpj

difficulty: Unknown
Owner: set to simonpj

I'm fixing (easy)

comment:2 Changed 7 years ago by simonpj@…

commit 419af69c1bea2cecce7b4bf58162cbfac81526f2

Author: Simon Peyton Jones <>
Date:   Tue Oct 2 17:39:46 2012 +0100

    Give PrimOps a NOINLINE pragma, to suppress silly warnings from dsRule
    See Trac #7287

 compiler/basicTypes/MkId.lhs |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

comment:3 Changed 7 years ago by simonpj

Resolution: fixed
Status: newclosed
Test Case: simplCore/should_compile/T7287

Good point, fixed.

comment:4 Changed 7 years ago by simonpj

Status: closedmerge

Actually this might be worth merging across.

comment:5 Changed 7 years ago by igloo

Milestone: 7.6.2

comment:6 Changed 7 years ago by igloo

Status: mergeclosed

comment:7 Changed 4 years ago by thomie

Owner: simonpj deleted
Resolution: fixed
Status: closednew

Commit 2d88a531b7e4dbf4016dca4b1ba3b5dc34256cf4 ("Improve warnings for rules that might not fire") effectively cancels the fix in commit 419af69c1bea2cecce7b4bf58162cbfac81526f2 ("Give PrimOps a NOINLINE pragma, to suppress silly warnings from dsRule").

There is a comment in testsuite/tests/simplCore/should_compile/T7287.hs that indicates this is intentional.

I'm reopening nevertheless, to be sure, since these two commits are so contradictory; maybe 419af69c1bea2cecce7b4bf58162cbfac81526f2 should be reverted?

Note: See TracTickets for help on using tickets.