Hi,

On 30 January 2017 at 17:00, Peter Bergner <berg...@vnet.ibm.com> wrote:
> On 1/27/17 5:43 PM, Segher Boessenkool wrote:
>>
>> On Fri, Jan 27, 2017 at 12:11:05PM -0600, Aaron Sawdey wrote:
>>>
>>> +            addi 9,4,7
>>> +            lwbrx 10,0,9
>>> +            addi 9,5,7
>>> +            lwbrx 9,0,9
>>
>>
>> It would be nice if this was
>>
>>         li 9,7
>>         lwbrx 10,9,4
>>         lwbrx 9,9,5
>
>
> Nicer still, we want the base address as the RA operand
> and the offset as the RB operand, so like so:
>
>         li 9,7
>         lwbrx 10,4,9
>         lwbrx 9,5,9
>
> On some processors, it matters performance wise.
>
> Peter
>

The updated test does not link when using newlib, missing random().

The small attached patch fixes this by calling rand() instead.
Tested on arm-none-eabi, aarch64-elf.

OK?

Christophe
gcc/testsuite/ChangeLog:

2017-01-31  Christophe Lyon  <christophe.l...@linaro.org>

        * gcc.dg/memcmp-1.c (static void test_driver_memcmp): Call
          rand() instead of random().


diff --git a/gcc/testsuite/gcc.dg/memcmp-1.c b/gcc/testsuite/gcc.dg/memcmp-1.c
index b4fd780..828a0ca 100644
--- a/gcc/testsuite/gcc.dg/memcmp-1.c
+++ b/gcc/testsuite/gcc.dg/memcmp-1.c
@@ -28,12 +28,12 @@ static void test_driver_memcmp (void (test_memcmp)(const 
char *, const char *, i
   for(l=0;l<sz;l++) {
     for(i=0;i<NRAND/sz;i++) {
       for(j=0;j<l;j++) {
-       buf1[j] = random() & 0xff;
+       buf1[j] = rand() & 0xff;
        buf2[j] = buf1[j];
       }
       for(j=l;j<sz;j++) {
-       buf1[j] = random() & 0xff;
-       buf2[j] = random() & 0xff;
+       buf1[j] = rand() & 0xff;
+       buf2[j] = rand() & 0xff;
       }
     }
     e = lib_memcmp(buf1,buf2,sz);

Reply via email to