[PATCH][rs6000] Fix two warnings in rs6000.c cause by bdesc_paired_preds

Revital1 Eres ERES@il.ibm.com
Fri Sep 7 07:39:00 GMT 2007


Hello,

> Why deconstify?  Can you instead remove the problematic cast and constify
> the variable that bdesc_paired_preds is assigned to?

This patch fixes the warnings as described above.
Bootstrapped on ppc64 (only C due to recent failure with
mainline on ppc).

OK for mainline?

Thanks,
Revital

2007-09-07  Revital Eres  <eres@il.ibm.com>

        * config/rs6000/rs6000.c (paired_init_builtins): Add const
        declaration to bdesc_paired_preds variable.
        (paired_expand_builtin): Likewise.

Index: config/rs6000/rs6000.c
===================================================================
--- config/rs6000/rs6000.c      (revision 128178)
+++ config/rs6000/rs6000.c      (working copy)
@@ -8208,7 +8208,7 @@
 {
   tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0);
   unsigned int fcode = DECL_FUNCTION_CODE (fndecl);
-  struct builtin_description *d;
+  const struct builtin_description *d;
   size_t i;

   *expandedp = true;
@@ -8225,7 +8225,7 @@
     }

   /* Expand the paired predicates.  */
-  d = (struct builtin_description *) bdesc_paired_preds;
+  d = bdesc_paired_preds;
   for (i = 0; i < ARRAY_SIZE (bdesc_paired_preds); i++, d++)
     if (d->code == fcode)
       return paired_expand_predicate_builtin (d->icode, exp, target);
@@ -9111,7 +9111,7 @@
 static void
 paired_init_builtins (void)
 {
-  struct builtin_description *d;
+  const struct builtin_description *d;
   size_t i;
   tree endlink = void_list_node;

@@ -9146,7 +9146,7 @@
               PAIRED_BUILTIN_STX);

   /* Predicates.  */
-  d = (struct builtin_description *) bdesc_paired_preds;
+  d = bdesc_paired_preds;
   for (i = 0; i < ARRAY_SIZE (bdesc_paired_preds); ++i, d++)
     {
       tree type;



More information about the Gcc-patches mailing list