Warning when compiling on NetBSD/sparc64

Martin Husemann martin at duskware.de
Sat Nov 30 20:11:52 UTC 2013


On Sat, Nov 30, 2013 at 08:29:11PM +0100, Niels Möller wrote:
> But I hope the compiler (gcc, unknown version) doesn't complain on
> expressions like

I get the same warnings with gcc 4.5.3 and 4.8.2.

> > A preprocessed version of divrem_2.c would help (the relevant line is
> > likely to be huge, please insert line breaks in it and compile to see
> > where the error is precisely).
> 
> That would definitely be helpful.

I modified the # NN line instructions to get proper offsets in the preprocessed
file the warning is in this asm statement:

       __asm__ ( "subcc %r4,%5,%1\n"
        "       subccc  %r6,%7,%%g0\n"
        "       subc    %r2,%3,%0" 
	 : "=r" ((r1)), "=&r" ((r0))
         : "rJ" ((r1)), "rI" ((d1)), "rJ" ((0)), "rI" ((d0)),
           "rJ" (((0)) >> 32), "rI" (((d0)) >> 32)
         : "cc");

which seems to be the sub_ddmmss macro.

And if you look carefully, you see: "rJ" (((0)) >> 32), i.e.: 0 >> 32,
which gcc warns about. Changing that to 0UL >> 32 makes the warning go away.


Martin



More information about the gmp-bugs mailing list