Commit f0035dca by Eric Botcazou Committed by Eric Botcazou

* gcc-interface/decl.c (annotate_value): Fix thinko in latest change.

From-SVN: r210403
parent c29f393f
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> 2014-05-06 Kenneth Zadeck <zadeck@naturalbridge.com>
Mike Stump <mikestump@comcast.net> Mike Stump <mikestump@comcast.net>
Richard Sandiford <rdsandiford@googlemail.com> Richard Sandiford <rdsandiford@googlemail.com>
......
...@@ -7515,15 +7515,16 @@ annotate_value (tree gnu_size) ...@@ -7515,15 +7515,16 @@ annotate_value (tree gnu_size)
case BIT_AND_EXPR: case BIT_AND_EXPR:
tcode = Bit_And_Expr; tcode = Bit_And_Expr;
/* For negative values, build NEGATE_EXPR of the opposite. Such values /* For negative values in sizetype, build NEGATE_EXPR of the opposite.
appear in expressions containing aligning patterns. Note that, since Such values appear in expressions with aligning patterns. Note that,
sizetype is unsigned, we have to jump through some hoops. */ since sizetype is unsigned, we have to jump through some hoops. */
if (TREE_CODE (TREE_OPERAND (gnu_size, 1)) == INTEGER_CST) if (TREE_CODE (TREE_OPERAND (gnu_size, 1)) == INTEGER_CST)
{ {
tree op1 = TREE_OPERAND (gnu_size, 1); 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)); pre_op1 = annotate_value (build1 (NEGATE_EXPR, sizetype, op1));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment