aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2014-05-13 21:17:07 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2014-05-13 21:17:07 +0000
commitb592332a156a6edcd40c413dcf91251ded29a2b2 (patch)
treeca964dc3da4109e22e6bdbc76a6807dbacf2ac73
parentf770db5dce4328b831d3c3e50322366f3e7b927a (diff)
* gcc-interface/decl.c (annotate_value): Fix thinko in latest change.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210403 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog4
-rw-r--r--gcc/ada/gcc-interface/decl.c11
2 files changed, 10 insertions, 5 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 57c5176c838..7167f97d6f8 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,7 @@
+2014-05-13 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (annotate_value): Fix thinko in latest change.
+
2014-05-06 Kenneth Zadeck <zadeck@naturalbridge.com>
Mike Stump <mikestump@comcast.net>
Richard Sandiford <rdsandiford@googlemail.com>
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 6d0b8b25038..43ed0b33c3b 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));
}
}