re PR c++/28302 (ICE with bit-complement for vectors)
authorAndrew Pinski <pinskia@gcc.gnu.org>
Thu, 17 Aug 2006 01:56:47 +0000 (18:56 -0700)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Thu, 17 Aug 2006 01:56:47 +0000 (18:56 -0700)
2006-08-16  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-08-16  Andrew Pinski  <pinskia@physics.uc.edu>

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

From-SVN: r116205

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

index f69c4ff58f6f44f83073c9b0f51561df55be7105..cde739dbb95a9fcfd39f91425cb7bdb6a531720a 100644 (file)
@@ -1,3 +1,9 @@
+2006-08-16  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-08-16  Jason Merrill  <jason@redhat.com>
 
        PR c++/28385
index 0ded718d4bbb5af07f0f9ae838a6d094becc9b02..f337328cfcd883721a9f74e1c534f5515650e849 100644 (file)
@@ -3996,7 +3996,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 9a6bf5666f7f7881443386cc78eab8b4e22676f0..28ab165937fa2278f9abb4fb47eecf3c5462c95a 100644 (file)
@@ -1,4 +1,9 @@
-2006-08-16  Zdenek Dvorak <dvorakz@suse.cz>
+2006-08-16  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR C++/28302
+       * g++.dg/ext/vector3.C: New test.
+
+2006-08-16  Zdenek Dvorak  <dvorakz@suse.cz>
 
        PR gcov/profile/26570
        * gcc.dg/pr26570.c: New test.
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;
+}
+