This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] obvious testcase fix





Testcase gcc.dg/vect/vect-reduc-1char.c started to fail sometime ago
because the following warning appeared:
"comparison is always 1 due to width of bit-field".

The warning refers to this comparison:
if (udiff != DIFF)
  abort();
where udiff is an unsigned char, and DIFF is 240.

The test data is fixed such that the result would fit in a char.

Tested on powerpc-darwin.

Changelog:

      * gcc.dg/vect/vect-reduc-1char.c: Fix data to fit in char.

Patch:

Index: vect-reduc-1char.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c,v
retrieving revision 1.2
diff -u -3 -p -r1.2 vect-reduc-1char.c
--- vect-reduc-1char.c  28 Jun 2005 07:33:11 -0000      1.2
+++ vect-reduc-1char.c  28 Jul 2005 15:17:56 -0000
@@ -4,13 +4,13 @@
 #include "tree-vect.h"

 #define N 16
-#define DIFF 242
+#define DIFF 122

 void
 main1 (unsigned char x, unsigned char max_result, unsigned char
min_result)
 {
   int i;
-  unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+  unsigned char ub[N] = {1,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
   unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
   unsigned char udiff = 2;
   unsigned char umax = x;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]