aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2014-05-13 21:17:07 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2014-05-13 21:17:07 +0000
commitf0035dca698e5e09dea846ec2d3f77aec0056274 (patch)
treeca964dc3da4109e22e6bdbc76a6807dbacf2ac73 /gcc/ada/gcc-interface/decl.c
parentc29f393f8326d3e4ec0a7841e8f3c45137f62795 (diff)
downloadgcc-f0035dca698e5e09dea846ec2d3f77aec0056274.zip
gcc-f0035dca698e5e09dea846ec2d3f77aec0056274.tar.gz
gcc-f0035dca698e5e09dea846ec2d3f77aec0056274.tar.bz2
* gcc-interface/decl.c (annotate_value): Fix thinko in latest change.
From-SVN: r210403
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r--gcc/ada/gcc-interface/decl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 6d0b8b2..43ed0b3 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -7515,15 +7515,16 @@ annotate_value (tree gnu_size)
case BIT_AND_EXPR:
tcode = Bit_And_Expr;
- /* For negative values, build NEGATE_EXPR of the opposite. Such values
- appear in expressions containing aligning patterns. Note that, since
- sizetype is unsigned, we have to jump through some hoops. */
+ /* For negative values in sizetype, build NEGATE_EXPR of the opposite.
+ Such values appear in expressions with aligning patterns. Note that,
+ since sizetype is unsigned, we have to jump through some hoops. */
if (TREE_CODE (TREE_OPERAND (gnu_size, 1)) == INTEGER_CST)
{
tree op1 = TREE_OPERAND (gnu_size, 1);
- if (wi::neg_p (op1))
+ wide_int signed_op1 = wi::sext (op1, TYPE_PRECISION (sizetype));
+ if (wi::neg_p (signed_op1))
{
- op1 = wide_int_to_tree (sizetype, wi::neg (op1));
+ op1 = wide_int_to_tree (sizetype, wi::neg (signed_op1));
pre_op1 = annotate_value (build1 (NEGATE_EXPR, sizetype, op1));
}
}