tree.c (get_unwidened): Decide whether to narrow a bitfield reference based on TYPE_S...
authorJason Merrill <jason@redhat.com>
Sat, 20 Dec 2003 03:21:25 +0000 (22:21 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Sat, 20 Dec 2003 03:21:25 +0000 (22:21 -0500)
        * tree.c (get_unwidened): Decide whether to narrow a bitfield
        reference based on TYPE_SIZE, not TYPE_PRECISION.
        * cp/cvt.c (convert_to_void): Don't warn about the RHS of a comma
        being useless if TREE_NO_UNUSED_WARNING is set.

        * stmt.c (parse_output_constraint): Warn about in-out constraint
        that doesn't allow a register.
        (parse_input_constraint): Warn about matching constraint that
        doesn't allow a register.

From-SVN: r74871

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/cvt.c
gcc/stmt.c
gcc/tree.c

index eea65d3f8d7096aad1f44f75cb4ba3696460ca70..a8b38dff93fdb5e83ac321fe84f412989cb3e7ed 100644 (file)
@@ -1,3 +1,13 @@
+2003-12-19  Jason Merrill  <jason@redhat.com>
+
+       * tree.c (get_unwidened): Decide whether to narrow a bitfield
+       reference based on TYPE_SIZE, not TYPE_PRECISION.
+
+       * stmt.c (parse_output_constraint): Warn about in-out constraint
+       that doesn't allow a register.
+       (parse_input_constraint): Warn about matching constraint that
+       doesn't allow a register.
+
 2003-12-19  James E Wilson  <wilson@specifixinc.com>
 
        * flow.c (mark_set_regs, case PARALLEL): Scan loop forwards.
        decimal formats.
 
 2003-12-19  Stuart Hastings  <stuart@apple.com>
+
        * gcc/config/i386/i386.c (ix86_expand_call, x86_output_mi_thunk):
        Trivial fixes for i386.c on Darwin/x86.
        
 2003-12-19  Fariborz Jahanian <fjahanian@apple.com>
+
         * config/rs6000/rs6000.c (legitimate_lo_sum_address_p): Add code to
         recognize macho-style lo_sum adrress patterns.
 
index f57eb1b7875f9ead5a34d46ffe503e25121712a7..91fb9df30792d482e4c6cdc4348040fd6e3c58f9 100644 (file)
@@ -24,6 +24,8 @@
 
        PR c++/13371
        * typeck.c (build_modify_expr): Stabilize lhs if we're narrowing.
+       * cvt.c (convert_to_void): Don't warn about the RHS of a comma
+       being useless if TREE_NO_UNUSED_WARNING is set.
 
 2003-12-18  Richard Henderson  <rth@redhat.com>
 
index 6f4af7dcafc685949578b8c834d0cc4f75a7b82e..6d4b961f7288be25f2613cc26304dbee813a444a 100644 (file)
@@ -817,7 +817,8 @@ convert_to_void (tree expr, const char *implicit)
         /* The second part of a compound expr contains the value.  */
         tree op1 = TREE_OPERAND (expr,1);
         tree new_op1 = convert_to_void
-         (op1, implicit ? "right-hand operand of comma" : NULL);
+         (op1, (implicit && !TREE_NO_UNUSED_WARNING (expr)
+                ? "right-hand operand of comma" : NULL));
         
         if (new_op1 != op1)
          {
index bc52a6b096b2eb2d226c840f0dd40d9f3d553a57..7b388dd6c1d8ff58253dc00abaa4b0a337447e2c 100644 (file)
@@ -1254,6 +1254,9 @@ parse_output_constraint (const char **constraint_p, int operand_num,
        break;
       }
 
+  if (*is_inout && !*allows_reg)
+    warning ("read-write constraint does not allow a register");
+
   return true;
 }
 
@@ -1269,6 +1272,7 @@ parse_input_constraint (const char **constraint_p, int input_num,
   const char *orig_constraint = constraint;
   size_t c_len = strlen (constraint);
   size_t j;
+  bool saw_match = false;
 
   /* Assume the constraint doesn't allow the use of either
      a register or memory.  */
@@ -1320,6 +1324,8 @@ parse_input_constraint (const char **constraint_p, int input_num,
          char *end;
          unsigned long match;
 
+         saw_match = true;
+
          match = strtoul (constraint + j, &end, 10);
          if (match >= (unsigned long) noutputs)
            {
@@ -1384,6 +1390,9 @@ parse_input_constraint (const char **constraint_p, int input_num,
        break;
       }
 
+  if (saw_match && !*allows_reg)
+    warning ("matching constraint does not allow a register");
+
   return true;
 }
 
index 52faeaf16e6aee1f84de37089791a79a86c399b3..b252a67c354c0e815b0998653d8043d8ae0edc87 100644 (file)
@@ -4123,7 +4123,7 @@ get_unwidened (tree op, tree for_type)
         The resulting extension to its nominal type (a fullword type)
         must fit the same conditions as for other extensions.  */
 
-      if (innerprec < TYPE_PRECISION (TREE_TYPE (op))
+      if (INT_CST_LT_UNSIGNED (TYPE_SIZE (type), TYPE_SIZE (TREE_TYPE (op)))
          && (for_type || ! DECL_BIT_FIELD (TREE_OPERAND (op, 1)))
          && (! uns || final_prec <= innerprec || unsignedp)
          && type != 0)