aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2013-05-29 15:00:29 +0000
committerRainer Orth <ro@gcc.gnu.org>2013-05-29 15:00:29 +0000
commit065ce7f17967ba542669469836127e02bd7f9e83 (patch)
treecd17c4536fed91355bfe60f36a95261d4d0ca6ed /gcc/c
parent16023efc1e94fcedcd76bef886c266a30976dbde (diff)
downloadgcc-065ce7f17967ba542669469836127e02bd7f9e83.zip
gcc-065ce7f17967ba542669469836127e02bd7f9e83.tar.gz
gcc-065ce7f17967ba542669469836127e02bd7f9e83.tar.bz2
Fix c/c-array-notation.c compilation failure (PR bootstrap/57450)
PR bootstrap/57450 * c-array-notation.c (length_mismatch_in_expr_p): Use absu_hwi. (build_array_notation_expr): Likewise. From-SVN: r199410
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-array-notation.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index d6d9856..d33fa2b 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,9 @@
+2013-05-29 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR bootstrap/57450
+ * c-array-notation.c (length_mismatch_in_expr_p): Use absu_hwi.
+ (build_array_notation_expr): Likewise.
+
2013-05-28 Balaji V. Iyer <balaji.v.iyer@intel.com>
* c-typeck.c (build_array_ref): Added a check to see if array's
diff --git a/gcc/c/c-array-notation.c b/gcc/c/c-array-notation.c
index c70345c..bf139a8 100644
--- a/gcc/c/c-array-notation.c
+++ b/gcc/c/c-array-notation.c
@@ -116,7 +116,7 @@ length_mismatch_in_expr_p (location_t loc, tree **list, size_t x, size_t y)
{
l_node = int_cst_value (list[ii][jj]);
l_start = int_cst_value (start);
- if (abs (l_start) != abs (l_node))
+ if (absu_hwi (l_start) != absu_hwi (l_node))
{
error_at (loc, "length mismatch in expression");
return true;
@@ -1561,7 +1561,7 @@ build_array_notation_expr (location_t location, tree lhs, tree lhs_origtype,
HOST_WIDE_INT r_length = int_cst_value (rhs_length[0][0]);
/* Length can be negative or positive. As long as the magnitude is OK,
then the array notation is valid. */
- if (abs (l_length) != abs (r_length))
+ if (absu_hwi (l_length) != absu_hwi (r_length))
{
error_at (location, "length mismatch between LHS and RHS");
pop_stmt_list (an_init);