aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2012-11-05 00:38:10 +0100
committerMarc Glisse <glisse@gcc.gnu.org>2012-11-04 23:38:10 +0000
commit4d6503ab30c85b8b8d917ff03a7acfe0e87af8ea (patch)
treecf6f967d78f49807405e7bc747965e10d3b1cb8d
parent4044815128625e0c4739fe2274078a6200511a3f (diff)
downloadgcc-4d6503ab30c85b8b8d917ff03a7acfe0e87af8ea.zip
gcc-4d6503ab30c85b8b8d917ff03a7acfe0e87af8ea.tar.gz
gcc-4d6503ab30c85b8b8d917ff03a7acfe0e87af8ea.tar.bz2
fold-const.c (fold_unary_loc): Disable conversion optimization for void type.
2012-11-05 Marc Glisse <marc.glisse@inria.fr> * fold-const.c (fold_unary_loc): Disable conversion optimization for void type. From-SVN: r193146
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/fold-const.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 91b970a..cf532f2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2012-11-05 Marc Glisse <marc.glisse@inria.fr>
+
+ * fold-const.c (fold_unary_loc): Disable conversion optimization
+ for void type.
+
2012-11-04 Thomas Schwinge <thomas@codesourcery.com>
* configure: Regenerate.
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 0caca2e..62a4e21 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -7749,7 +7749,8 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0)
return build2_loc (loc, TREE_CODE (op0), type,
TREE_OPERAND (op0, 0),
TREE_OPERAND (op0, 1));
- else if (!INTEGRAL_TYPE_P (type) && TREE_CODE (type) != VECTOR_TYPE)
+ else if (!INTEGRAL_TYPE_P (type) && !VOID_TYPE_P (type)
+ && TREE_CODE (type) != VECTOR_TYPE)
return build3_loc (loc, COND_EXPR, type, op0,
constant_boolean_node (true, type),
constant_boolean_node (false, type));