aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/convert.c
diff options
context:
space:
mode:
authorYiran Wang <yiran@google.com>2015-06-23 15:33:17 -0700
committerYiran Wang <yiran@google.com>2015-06-29 10:56:28 -0700
commit1d9fec7937f45dde5e04cac966a2d9a12f2fc15a (patch)
tree3fbcd18a379a05fd6d43491a107e1f36bc61b185 /gcc-4.9/gcc/convert.c
parentf378ebf14df0952eae870c9865bab8326aa8f137 (diff)
downloadtoolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.gz
toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.bz2
toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.zip
Synchronize with google/gcc-4_9 to r224707 (from r214835)
Change-Id: I3d6f06fc613c8f8b6a82143dc44b7338483aac5d
Diffstat (limited to 'gcc-4.9/gcc/convert.c')
-rw-r--r--gcc-4.9/gcc/convert.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/convert.c b/gcc-4.9/gcc/convert.c
index 91c1da265..cb57b29e0 100644
--- a/gcc-4.9/gcc/convert.c
+++ b/gcc-4.9/gcc/convert.c
@@ -97,6 +97,15 @@ convert_to_real (tree type, tree expr)
enum built_in_function fcode = builtin_mathfn_code (expr);
tree itype = TREE_TYPE (expr);
+ if (TREE_CODE (expr) == COMPOUND_EXPR)
+ {
+ tree t = convert_to_real (type, TREE_OPERAND (expr, 1));
+ if (t == TREE_OPERAND (expr, 1))
+ return expr;
+ return build2_loc (EXPR_LOCATION (expr), COMPOUND_EXPR, TREE_TYPE (t),
+ TREE_OPERAND (expr, 0), t);
+ }
+
/* Disable until we figure out how to decide whether the functions are
present in runtime. */
/* Convert (float)sqrt((double)x) where x is float into sqrtf(x) */
@@ -403,6 +412,15 @@ convert_to_integer (tree type, tree expr)
return error_mark_node;
}
+ if (ex_form == COMPOUND_EXPR)
+ {
+ tree t = convert_to_integer (type, TREE_OPERAND (expr, 1));
+ if (t == TREE_OPERAND (expr, 1))
+ return expr;
+ return build2_loc (EXPR_LOCATION (expr), COMPOUND_EXPR, TREE_TYPE (t),
+ TREE_OPERAND (expr, 0), t);
+ }
+
/* Convert e.g. (long)round(d) -> lround(d). */
/* If we're converting to char, we may encounter differing behavior
between converting from double->char vs double->long->char.
@@ -891,6 +909,14 @@ convert_to_complex (tree type, tree expr)
if (TYPE_MAIN_VARIANT (elt_type) == TYPE_MAIN_VARIANT (subtype))
return expr;
+ else if (TREE_CODE (expr) == COMPOUND_EXPR)
+ {
+ tree t = convert_to_complex (type, TREE_OPERAND (expr, 1));
+ if (t == TREE_OPERAND (expr, 1))
+ return expr;
+ return build2_loc (EXPR_LOCATION (expr), COMPOUND_EXPR,
+ TREE_TYPE (t), TREE_OPERAND (expr, 0), t);
+ }
else if (TREE_CODE (expr) == COMPLEX_EXPR)
return fold_build2 (COMPLEX_EXPR, type,
convert (subtype, TREE_OPERAND (expr, 0)),