aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-10-22 08:38:15 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-10-22 08:38:15 +0000
commita8fc25795155d4c4d18c8c5b099748a8178b38f6 (patch)
tree4694c561d25d8bedd003e8cea3438b6d9b14d34d /gcc/c
parentcfed37a03b7a495b25e63d335e9f00e2dc9583f0 (diff)
downloadgcc-a8fc25795155d4c4d18c8c5b099748a8178b38f6.zip
gcc-a8fc25795155d4c4d18c8c5b099748a8178b38f6.tar.gz
gcc-a8fc25795155d4c4d18c8c5b099748a8178b38f6.tar.bz2
fold-const.c (fold_addr_of_array_ref_difference): Properly convert operands before folding a MINUS_EXPR.
2015-10-22 Richard Biener <rguenther@suse.de> * fold-const.c (fold_addr_of_array_ref_difference): Properly convert operands before folding a MINUS_EXPR. (fold_binary_loc): Move simplification of MINUS_EXPR on converted POINTER_PLUS_EXPRs ... * match.pd: ... here. c/ * c-typeck.c (c_finish_omp_clauses): Properly convert operands before folding a MINUS_EXPR. cp/ * semantics.c (cp_finish_omp_clause_depend_sink): Properly convert before folding a MINUS_EXPR. (finish_omp_clauses): Likewise. From-SVN: r229167
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog5
-rw-r--r--gcc/c/c-typeck.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index b5179a3..aed7a62 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,8 @@
+2015-10-22 Richard Biener <rguenther@suse.de>
+
+ * c-typeck.c (c_finish_omp_clauses): Properly convert operands
+ before folding a MINUS_EXPR.
+
2015-10-21 Marek Polacek <polacek@redhat.com>
PR c/68024
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 6b32781..61c5313 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -12547,7 +12547,9 @@ c_finish_omp_clauses (tree clauses, bool is_omp, bool declare_simd)
s = pointer_int_sum (OMP_CLAUSE_LOCATION (c), PLUS_EXPR,
OMP_CLAUSE_DECL (c), s);
s = fold_build2_loc (OMP_CLAUSE_LOCATION (c), MINUS_EXPR,
- sizetype, s, OMP_CLAUSE_DECL (c));
+ sizetype, fold_convert (sizetype, s),
+ fold_convert
+ (sizetype, OMP_CLAUSE_DECL (c)));
if (s == error_mark_node)
s = size_one_node;
OMP_CLAUSE_LINEAR_STEP (c) = s;
@@ -12671,7 +12673,9 @@ c_finish_omp_clauses (tree clauses, bool is_omp, bool declare_simd)
neg ? MINUS_EXPR : PLUS_EXPR,
decl, offset);
t2 = fold_build2_loc (OMP_CLAUSE_LOCATION (c), MINUS_EXPR,
- sizetype, t2, decl);
+ sizetype,
+ fold_convert (sizetype, t2),
+ fold_convert (sizetype, decl));
if (t2 == error_mark_node)
{
remove = true;