Hi!

When tweaking c-common.c last time, I was looking for TREE_INT_CST_LOW
uses and which are justified and which aren't.  This case caught my eyes,
while it isn't wrong, pretty much everywhere in the compiler we after
tree_fits_uhwi_p use tree_to_uhwi.

Bootstrapped/regtested on x86_64-linux and i686-linux, committed as obvious.

2017-11-21  Jakub Jelinek  <ja...@redhat.com>

        * c-common.c (get_nonnull_operand): Use tree_to_uhwi.

--- gcc/c-family/c-common.c.jj  2017-11-21 09:05:08.000000000 +0100
+++ gcc/c-family/c-common.c     2017-11-21 12:17:19.300064345 +0100
@@ -5359,7 +5359,7 @@ get_nonnull_operand (tree arg_num_expr,
   /* Verify the arg number is a small constant.  */
   if (tree_fits_uhwi_p (arg_num_expr))
     {
-      *valp = TREE_INT_CST_LOW (arg_num_expr);
+      *valp = tree_to_uhwi (arg_num_expr);
       return true;
     }
   else

        Jakub

Reply via email to