http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46274

           Summary: testsuite/gcc.dg: operator precedence
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: ni...@nikai.net


The below tests appear not to work as intended because they
seem to always pass due to operator precedence (== and !=
before &, ^, |).

---
diff -u -p a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c
b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c
--- a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c 2010-10-29
11:08:43.273700439 +0200
+++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c 2010-11-02
18:20:05.501608310 +0100
@@ -30,7 +30,7 @@ int main ()
   /* check results:  */
   for (i = 0; i < N; i++)
     {
-      if (ia[i] != ib[i] & ic[i])
+      if (ia[i] != (ib[i] & ic[i]))
         abort ();
     }

diff -u -p a/gcc/testsuite/gcc.dg/vect/vect-19.c
b/gcc/testsuite/gcc.dg/vect/vect-19.c
--- a/gcc/testsuite/gcc.dg/vect/vect-19.c 2010-10-29 11:08:53.205318077 +0200
+++ b/gcc/testsuite/gcc.dg/vect/vect-19.c 2010-11-02 18:20:12.075658468 +0100
@@ -81,7 +81,7 @@ main1 ()
   /* check results:  */
   for (i = 0; i <N; i++)
     {
-      if (ia[i] != ib[i] ^ ic[i])
+      if (ia[i] != (ib[i] ^ ic[i]))
         abort ();
     }

@@ -95,7 +95,7 @@ main1 ()
   /* check results:  */
   for (i = 0; i <N; i++)
     {
-      if (ca[i] != cb[i] ^ cc[i])
+      if (ca[i] != (cb[i] ^ cc[i]))
         abort ();
     }

@@ -109,7 +109,7 @@ main1 ()
   /* check results:  */
   for (i = 0; i <N; i++)
     {
-      if (sa[i] != sb[i] ^ sc[i])
+      if (sa[i] != (sb[i] ^ sc[i]))
         abort ();
     }

diff -u -p a/gcc/testsuite/gcc.dg/vect/vect-17.c
b/gcc/testsuite/gcc.dg/vect/vect-17.c
--- a/gcc/testsuite/gcc.dg/vect/vect-17.c 2010-10-29 11:08:53.075296903 +0200
+++ b/gcc/testsuite/gcc.dg/vect/vect-17.c 2010-11-02 18:20:13.955863347 +0100
@@ -82,7 +82,7 @@ main1 ()
   /* check results:  */
   for (i = 0; i <N; i++)
     {
-      if (ia[i] != ib[i] & ic[i])
+      if (ia[i] != (ib[i] & ic[i]))
         abort ();
     }

@@ -96,7 +96,7 @@ main1 ()
   /* check results:  */
   for (i = 0; i <N; i++)
     {
-      if (ca[i] != cb[i] & cc[i])
+      if (ca[i] != (cb[i] & cc[i]))
         abort ();
     }

@@ -110,7 +110,7 @@ main1 ()
   /* check results:  */
   for (i = 0; i <N; i++)
     {
-      if (sa[i] != sb[i] & sc[i])
+      if (sa[i] != (sb[i] & sc[i]))
         abort ();
     }

Reply via email to