]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/28302 (ICE with bit-complement for vectors)
authorAndrew Pinski <pinskia@physics.uc.edu>
Thu, 12 Oct 2006 04:13:36 +0000 (04:13 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Thu, 12 Oct 2006 04:13:36 +0000 (21:13 -0700)
2006-10-11  Andrew Pinski  <pinskia@physics.uc.edu>

        PR c++/28302
        * typeck.c (build_unary_op <case BIT_NOT_EXPR:>): Don't call
        perform_integral_promotions for non integral type

2006-10-11  Andrew Pinski  <pinskia@physics.uc.edu>

        PR C++/28302
        * g++.dg/ext/vector3.C: New test.

From-SVN: r117657

gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/vector3.C [new file with mode: 0644]

index 788e393d0fcc92da1f88423e055c62d805150376..eb53b785c34a29fc93b2ff2ba5d81bf25c1d094b 100644 (file)
@@ -1,3 +1,9 @@
+2006-10-11  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR c++/28302
+       * typeck.c (build_unary_op <case BIT_NOT_EXPR:>): Don't call
+       perform_integral_promotions for non integral type
+
 2006-10-11  Andrew Pinski  <pinskia@physics.uc.edu>
 
        PR C++/29002
index ed7258399b393b5b9594a94682a2114be269c49a..38e542b4964cc57549bef1846fe434fe8a45fcc7 100644 (file)
@@ -3784,7 +3784,7 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
       else if (!(arg = build_expr_type_conversion (WANT_INT | WANT_ENUM,
                                                   arg, true)))
        errstring = "wrong type argument to bit-complement";
-      else if (!noconvert)
+      else if (!noconvert && CP_INTEGRAL_TYPE_P (TREE_TYPE (arg)))
        arg = perform_integral_promotions (arg);
       break;
 
index c28ad3893cf55517c154bd908ca95cdcc17f288d..d1fa3199317158700b425e6d13f2ddca1529026e 100644 (file)
@@ -1,3 +1,8 @@
+2006-10-11  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR C++/28302
+       * g++.dg/ext/vector3.C: New test.
+
 2006-10-11  Andrew Pinski  <pinskia@physics.uc.edu>
 
        PR C++/29002
diff --git a/gcc/testsuite/g++.dg/ext/vector3.C b/gcc/testsuite/g++.dg/ext/vector3.C
new file mode 100644 (file)
index 0000000..1a67cf7
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+// PR c++/28302
+
+int __attribute__((vector_size(8))) x;
+
+void foo()
+{
+  ~x;
+}
+