Patchwork testsuite/gcc.dg/vect/pr44507.c

login
register
mail settings
Submitter Alan Modra
Date June 16, 2010, 4:23 a.m.
Message ID <20100616042317.GI9748@bubble.grove.modra.org>
Download mbox | patch
Permalink /patch/55839/
State New
Headers show

Comments

Alan Modra - June 16, 2010, 4:23 a.m.
testsuite/gcc.dg/vect/pr44507.c is invalid on LP64.  This:

    curVal = *((unsigned long *)(&pArray[index]));

loads 8 bytes, ie. the last time around the loop this loads 4 bytes past the
end of the array.  On big-endian machines this is the low 32 bits so the test
fails.

Committing the following as obvious.

	* gcc.dg/vect/pr44507.c (seeIf256ByteArrayIsConstant): Correct cast.

Patch

Index: gcc/testsuite/gcc.dg/vect/pr44507.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/pr44507.c	(revision 160773)
+++ gcc/testsuite/gcc.dg/vect/pr44507.c	(working copy)
@@ -16,7 +16,7 @@  int seeIf256ByteArrayIsConstant(
            index < 64;
            index += (int)sizeof(unsigned int))
         {
-          curVal = *((unsigned long *)(&pArray[index]));
+          curVal = *((unsigned int *)(&pArray[index]));
           orVal = orVal | curVal;
           andVal = andVal & curVal;
         }