Hi Michael,

On 11/13/2018 10:58 PM, Michael Ellerman wrote:
It looks like binutils 2.27 doesn't accept ULL but binutils 2.28 does.

Ah yep, here:

   
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=86b80085c889cd388fa677a5ae9053fd4be3776c

The following trivial workaround can solve it by forcing a type promotion on
the compiler side whilst leaving the macro taken into the asm code without
the UL string:

diff --git a/tools/testing/selftests/powerpc/mm/wild_bctr.c 
b/tools/testing/selftests/powerpc/mm/wild_bctr.c
index 90469a9..d2772f4 100644
--- a/tools/testing/selftests/powerpc/mm/wild_bctr.c
+++ b/tools/testing/selftests/powerpc/mm/wild_bctr.c
@@ -47,8 +47,9 @@ static int ok(void)
          return 0;
   }
-#define REG_POISON 0x5a5aUL
-#define POISONED_REG(n)        ((REG_POISON << 48) | ((n) << 32) | (REG_POISON 
<< 16) | (n))
+#define REG_POISON     0x5a5a
+#define POISONED_REG(n)        (((REG_POISON+0UL) << 48) | ((n) << 32) | 
((REG_POISON+0UL) << 16) | (n))
static inline void poison_regs(void)
   {


Should I contribute such a fix?

Yes thanks.

Segher kindly suggested to use explicitly "unsigned long" (thanks!), so I sent
a v2 to:

https://lists.ozlabs.org/pipermail/linuxppc-dev/2018-November/181434.html


Best regards,
Gustavo

Reply via email to