Don't error on GCC inlining warning in rts
authorBartosz Nitka <niteria@gmail.com>
Wed, 22 Jun 2016 13:22:45 +0000 (06:22 -0700)
committerBartosz Nitka <niteria@gmail.com>
Wed, 22 Jun 2016 13:22:59 +0000 (06:22 -0700)
The warning for reference:
```
rts/RaiseAsync.c: In function ‘throwToMsg’:

rts/SMPClosureOps.h:65:0: error:
     error: inlining failed in call to ‘lockClosure’: call is unlikely
and code size would grow

rts/RaiseAsync.c:305:0: error:  error: called from here

rts/SMPClosureOps.h:65:0: error:
     error: inlining failed in call to ‘lockClosure’: call is unlikely
and code size would grow
```

This warning triggers on `gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)`
and it doesn't trigger with new GCCs.

Test Plan: build ghc/rts

Reviewers: bgamari, simonmar, austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2353

mk/warnings.mk

index 61d60ab..5ca097f 100644 (file)
@@ -21,13 +21,14 @@ ifeq "$(GccLT46)" "NO"
 ifneq "$(HostOS_CPP)" "mingw32"
 SRC_CC_WARNING_OPTS += -Werror=unused-but-set-variable
 endif
-# gcc 4.6 gives 3 warning for giveCapabilityToTask not being inlined
-SRC_CC_WARNING_OPTS += -Wno-error=inline
 endif
 
 ifeq "$(GccLT44)" "NO"
 # Suppress the warning about __sync_fetch_and_nand (#9678).
 libraries/ghc-prim/cbits/atomic_CC_OPTS += -Wno-sync-nand
+# gcc 4.6 gives 3 warnings for giveCapabilityToTask not being inlined
+# gcc 4.4 gives 2 warnings for lockClosure not being inlined
+SRC_CC_WARNING_OPTS += -Wno-error=inline
 endif
 
 else