This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Avoid -Wsign-compare warning on 4.8 branch
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 6 Mar 2014 09:25:00 +0100
- Subject: [committed] Avoid -Wsign-compare warning on 4.8 branch
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
I've noticed a new -Wsign-compare warning on 4.8 branch, this
patch just changes the code to look like on the trunk.
This is all guarded with if (dist > 0), so the cast is harmless.
Bootstrapped/regtested on x86_64-linux and i686-linux, committed
to trunk as obvious.
2014-03-06 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/60276
* tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Avoid
a -Wsign-compare warning.
--- gcc/tree-vect-data-refs.c.jj 2014-03-05 21:55:53.000000000 +0100
+++ gcc/tree-vect-data-refs.c 2014-03-05 22:38:29.004898095 +0100
@@ -744,7 +744,7 @@ vect_analyze_data_ref_dependence (struct
Only need to handle read-after-write dependence. */
if (DR_IS_READ (drb)
&& (STMT_VINFO_MIN_NEG_DIST (stmtinfo_b) == 0
- || STMT_VINFO_MIN_NEG_DIST (stmtinfo_b) > dist))
+ || STMT_VINFO_MIN_NEG_DIST (stmtinfo_b) > (unsigned)dist))
STMT_VINFO_MIN_NEG_DIST (stmtinfo_b) = dist;
continue;
}
Jakub