* typeck.c (type_after_usual_arithmetic_conversions):
Fix assertion for vector types.
(build_binary_op): Use temporary for inner type of vector types.
* g++.dg/ext/vector5.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119416
138bc75d-0d04-0410-961f-
82ee72b054a4
+2006-12-01 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/30022
+ * typeck.c (type_after_usual_arithmetic_conversions):
+ Fix assertion for vector types.
+ (build_binary_op): Use temporary for inner type of vector types.
+
2006-12-01 Ryan Mansfield <rmansfield@qnx.com>
PR c++/29066
2006-12-01 Ryan Mansfield <rmansfield@qnx.com>
PR c++/29066
|| TREE_CODE (t1) == ENUMERAL_TYPE);
gcc_assert (ARITHMETIC_TYPE_P (t2)
|| TREE_CODE (t2) == COMPLEX_TYPE
|| TREE_CODE (t1) == ENUMERAL_TYPE);
gcc_assert (ARITHMETIC_TYPE_P (t2)
|| TREE_CODE (t2) == COMPLEX_TYPE
- || TREE_CODE (t1) == VECTOR_TYPE
+ || TREE_CODE (t2) == VECTOR_TYPE
|| TREE_CODE (t2) == ENUMERAL_TYPE);
/* In what follows, we slightly generalize the rules given in [expr] so
|| TREE_CODE (t2) == ENUMERAL_TYPE);
/* In what follows, we slightly generalize the rules given in [expr] so
&& (code1 == INTEGER_TYPE || code1 == REAL_TYPE
|| code1 == COMPLEX_TYPE || code1 == VECTOR_TYPE))
{
&& (code1 == INTEGER_TYPE || code1 == REAL_TYPE
|| code1 == COMPLEX_TYPE || code1 == VECTOR_TYPE))
{
+ enum tree_code tcode0 = code0, tcode1 = code1;
+
if (TREE_CODE (op1) == INTEGER_CST && integer_zerop (op1))
warning (OPT_Wdiv_by_zero, "division by zero in %<%E / 0%>", op0);
else if (TREE_CODE (op1) == REAL_CST && real_zerop (op1))
warning (OPT_Wdiv_by_zero, "division by zero in %<%E / 0.%>", op0);
if (TREE_CODE (op1) == INTEGER_CST && integer_zerop (op1))
warning (OPT_Wdiv_by_zero, "division by zero in %<%E / 0%>", op0);
else if (TREE_CODE (op1) == REAL_CST && real_zerop (op1))
warning (OPT_Wdiv_by_zero, "division by zero in %<%E / 0.%>", op0);
- if (code0 == COMPLEX_TYPE || code0 == VECTOR_TYPE)
- code0 = TREE_CODE (TREE_TYPE (TREE_TYPE (op0)));
- if (code1 == COMPLEX_TYPE || code1 == VECTOR_TYPE)
- code1 = TREE_CODE (TREE_TYPE (TREE_TYPE (op1)));
+ if (tcode0 == COMPLEX_TYPE || tcode0 == VECTOR_TYPE)
+ tcode0 = TREE_CODE (TREE_TYPE (TREE_TYPE (op0)));
+ if (tcode1 == COMPLEX_TYPE || tcode1 == VECTOR_TYPE)
+ tcode1 = TREE_CODE (TREE_TYPE (TREE_TYPE (op1)));
- if (!(code0 == INTEGER_TYPE && code1 == INTEGER_TYPE))
+ if (!(tcode0 == INTEGER_TYPE && tcode1 == INTEGER_TYPE))
resultcode = RDIV_EXPR;
else
/* When dividing two signed integers, we have to promote to int.
resultcode = RDIV_EXPR;
else
/* When dividing two signed integers, we have to promote to int.
2006-12-01 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
2006-12-01 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+ PR c++/30022
+ * g++.dg/ext/vector5.C: New test.
+
PR c++/30021
* g++.dg/other/main1.C: New test.
PR c++/30021
* g++.dg/other/main1.C: New test.
--- /dev/null
+// PR c++/30022
+// { dg-do compile }
+
+void foo()
+{
+ int __attribute__((vector_size(8))) v;
+ v = 1/v; // { dg-error "invalid operands of types" }
+}