diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-04-12 13:57:45 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-04-12 13:57:45 +0000 |
commit | 6f757bccd70845f86f759bde1ace2adb355cc7ac (patch) | |
tree | 3ee9c7544c16c0adf77cb08020ba136611a605cf /gcc/expr.c | |
parent | 1bcbd566cc98b51f757dbaf993dcced045ebc93e (diff) |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246876 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index 91d7ea21722..29ebad3a061 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, |