aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-09-13 18:57:15 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2012-09-13 18:57:15 +0200
commit9feb29df994174d571b3fba6e6a60c24a2dc111c (patch)
treedceaecf6caccc38202d585c1f0c520e92dbf4fbb /gcc/c
parent8bf4ee3426b1db80cf4cb18295477ae85c425105 (diff)
downloadgcc-9feb29df994174d571b3fba6e6a60c24a2dc111c.zip
gcc-9feb29df994174d571b3fba6e6a60c24a2dc111c.tar.gz
gcc-9feb29df994174d571b3fba6e6a60c24a2dc111c.tar.bz2
re PR c/54559 (, ICE in gimplify_expr, at gimplify.c:7592)
PR c/54559 * c-typeck.c (c_finish_return): Do convert to BOOLEAN_TYPE or COMPLEX_TYPE with in_late_binary_op set temporarily to true. * gcc.c-torture/compile/pr54559.c: New test. From-SVN: r191270
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-typeck.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 11f9be7..f075776 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,9 @@
+2012-09-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/54559
+ * c-typeck.c (c_finish_return): Do convert to BOOLEAN_TYPE or
+ COMPLEX_TYPE with in_late_binary_op set temporarily to true.
+
2012-08-31 Jakub Jelinek <jakub@redhat.com>
PR c/54428
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index b5fb9c9..2d74da8 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -8682,12 +8682,18 @@ c_finish_return (location_t loc, tree retval, tree origtype)
npc, NULL_TREE, NULL_TREE, 0);
tree res = DECL_RESULT (current_function_decl);
tree inner;
+ bool save;
current_function_returns_value = 1;
if (t == error_mark_node)
return NULL_TREE;
+ save = in_late_binary_op;
+ if (TREE_CODE (TREE_TYPE (res)) == BOOLEAN_TYPE
+ || TREE_CODE (TREE_TYPE (res)) == COMPLEX_TYPE)
+ in_late_binary_op = true;
inner = t = convert (TREE_TYPE (res), t);
+ in_late_binary_op = save;
/* Strip any conversions, additions, and subtractions, and see if
we are returning the address of a local variable. Warn if so. */