From: Andrew Pinski Date: Thu, 12 Oct 2006 04:13:36 +0000 (+0000) Subject: re PR c++/28302 (ICE with bit-complement for vectors) X-Git-Tag: releases/gcc-4.0.4~291 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=804d708570f2898179922413ee8eb7bdec43f103;p=thirdparty%2Fgcc.git re PR c++/28302 (ICE with bit-complement for vectors) 2006-10-11 Andrew Pinski PR c++/28302 * typeck.c (build_unary_op ): Don't call perform_integral_promotions for non integral type 2006-10-11 Andrew Pinski PR C++/28302 * g++.dg/ext/vector3.C: New test. From-SVN: r117657 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 788e393d0fcc..eb53b785c34a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2006-10-11 Andrew Pinski + + PR c++/28302 + * typeck.c (build_unary_op ): Don't call + perform_integral_promotions for non integral type + 2006-10-11 Andrew Pinski PR C++/29002 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index ed7258399b39..38e542b4964c 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c28ad3893cf5..d1fa31993171 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-10-11 Andrew Pinski + + PR C++/28302 + * g++.dg/ext/vector3.C: New test. + 2006-10-11 Andrew Pinski 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 index 000000000000..1a67cf76a61d --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/vector3.C @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "" } */ + +// PR c++/28302 + +int __attribute__((vector_size(8))) x; + +void foo() +{ + ~x; +} +