aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2017-04-12 15:57:45 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2017-04-12 15:57:45 +0200
commit76873758402927ca5fca67abc018eab862fd1b96 (patch)
tree3ee9c7544c16c0adf77cb08020ba136611a605cf /gcc/expr.c
parent940c9a7c2cf3bbbf43b0602c9283bf7579cf05ec (diff)
downloadgcc-76873758402927ca5fca67abc018eab862fd1b96.zip
gcc-76873758402927ca5fca67abc018eab862fd1b96.tar.gz
gcc-76873758402927ca5fca67abc018eab862fd1b96.tar.bz2
re PR middle-end/80163 (ICE on hopefully valid code)
PR c/80163 * expr.c <CASE_CONVERT>: For EXPAND_INITIALIZER determine SIGN_EXTEND vs. ZERO_EXTEND based on signedness of treeop0's type rather than signedness of the result type. * gcc.dg/torture/pr80163.c: New test. From-SVN: r246876
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 91d7ea2..29ebad3 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -8333,7 +8333,8 @@ expand_expr_real_2 (sepops ops, rtx target, machine_mode tmode,
}
else if (modifier == EXPAND_INITIALIZER)
- op0 = gen_rtx_fmt_e (unsignedp ? ZERO_EXTEND : SIGN_EXTEND, mode, op0);
+ op0 = gen_rtx_fmt_e (TYPE_UNSIGNED (TREE_TYPE (treeop0))
+ ? ZERO_EXTEND : SIGN_EXTEND, mode, op0);
else if (target == 0)
op0 = convert_to_mode (mode, op0,