[commit: ghc] master: UNREG: PprC: add support for of W16 literals (Ticket #15237) (01c9d95)

Gabor Greif ggreif at gmail.com
Fri Jun 15 08:49:41 UTC 2018


Thanks for fixing this!

I am in the process of building an unregisterised MIPS64
cross-compiler and just noticed this warning running by:

  HC [stage 1] libraries/base/dist-install/build/GHC/Show.p_o
/tmp/ghc414_0/ghc_7.hc: In function '_c53i':

/tmp/ghc414_0/ghc_7.hc:1483:17: error:
     warning: integer constant is so large that it is unsigned
     _s4Lo = (_s4Ld+-9223372036854775808) + (_s4Lg + _s4L9);
                     ^
     |
1483 | _s4Lo = (_s4Ld+-9223372036854775808) + (_s4Lg + _s4L9);
     |                 ^

Not sure whether I should be worried (there seem to be others of this
kind) or a simple change in the datatype (int -> unsigned) could
silence this.

Cheers,

    Gabor


On 6/15/18, git at git.haskell.org <git at git.haskell.org> wrote:
> Repository : ssh://git@git.haskell.org/ghc
>
> On branch  : master
> Link       :
> http://ghc.haskell.org/trac/ghc/changeset/01c9d95aca12caf5c954320a2a82335b32568554/ghc
>
>>---------------------------------------------------------------
>
> commit 01c9d95aca12caf5c954320a2a82335b32568554
> Author: Sergei Trofimovich <slyfox at gentoo.org>
> Date:   Thu Jun 14 23:13:16 2018 +0100
>
>     UNREG: PprC: add support for of W16 literals (Ticket #15237)
>
>     Fix UNREG build failure for 32-bit targets.
>
>     This change is an equivalent of commit
>     0238a6c78102d43dae2f56192bd3486e4f9ecf1d
>     ("UNREG: PprC: add support for of W32 literals")
>
>     The change allows combining two subwords into one word
>     on 32-bit targets. Tested on nios2-unknown-linux-gnu.
>
>     GHC Trac Issues: #15237
>
>     Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>
>
>
>>---------------------------------------------------------------
>
> 01c9d95aca12caf5c954320a2a82335b32568554
>  compiler/cmm/PprC.hs | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
> index e46fff1..8b30bbf 100644
> --- a/compiler/cmm/PprC.hs
> +++ b/compiler/cmm/PprC.hs
> @@ -546,6 +546,14 @@ pprStatics dflags (CmmStaticLit (CmmInt a W32) :
>                              rest)
>      else pprStatics dflags (CmmStaticLit (CmmInt ((shiftL b 32) .|. a) W64)
> :
>                              rest)
> +pprStatics dflags (CmmStaticLit (CmmInt a W16) :
> +                   CmmStaticLit (CmmInt b W16) : rest)
> +  | wordWidth dflags == W32
> +  = if wORDS_BIGENDIAN dflags
> +    then pprStatics dflags (CmmStaticLit (CmmInt ((shiftL a 16) .|. b) W32)
> :
> +                            rest)
> +    else pprStatics dflags (CmmStaticLit (CmmInt ((shiftL b 16) .|. a) W32)
> :
> +                            rest)
>  pprStatics dflags (CmmStaticLit (CmmInt _ w) : _)
>    | w /= wordWidth dflags
>    = pprPanic "pprStatics: cannot emit a non-word-sized static literal" (ppr
> w)
>
> _______________________________________________
> ghc-commits mailing list
> ghc-commits at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-commits
>


More information about the ghc-devs mailing list