[Bug tree-optimization/50005] [4.7 Regression] ipa-inline-analysis.c:1876:41: error: comparison between signed an d unsigned integer expressions

mikpe at it dot uu.se gcc-bugzilla@gcc.gnu.org
Sun Aug 7 20:27:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50005

Mikael Pettersson <mikpe at it dot uu.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpe at it dot uu.se

--- Comment #1 from Mikael Pettersson <mikpe at it dot uu.se> 2011-08-07 20:26:31 UTC ---
Casting the VEC_length call to (int) fixes the problem, and is consistent with
several other comparisons involving VEC_int in this file:

--- gcc-4.7-20110806/gcc/ipa-inline-analysis.c.~1~      2011-08-05
22:56:05.000000000 +0200
+++ gcc-4.7-20110806/gcc/ipa-inline-analysis.c  2011-08-07 12:15:46.000000000
+0200
@@ -1873,7 +1873,7 @@ remap_predicate (struct inline_summary *
                 /* See if we can remap condition operand to caller's operand.
                    Otherwise give up.  */
                 if (!operand_map
-                    || VEC_length (int, operand_map) <= c->operand_num
+                    || (int)VEC_length (int, operand_map) <= c->operand_num
                     || VEC_index (int, operand_map, c->operand_num) == -1)
                   cond_predicate = true_predicate ();
                 else

You need --disable-build-poststage1-with-cxx to trigger the problem.  The C++
FE fails to diagnose this signed/unsigned comparison due to PR50012.



More information about the Gcc-bugs mailing list