aboutsummaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2003-12-19 22:21:25 -0500
committerJason Merrill <jason@gcc.gnu.org>2003-12-19 22:21:25 -0500
commitf3da0ead0c5c3772c8322cc4aad8deeb382ef2dd (patch)
tree9bb4e10d802613726fd9fcebe175b05cee831ce4 /gcc/stmt.c
parent46eb4b398948ddef881e51b9c49d96e242d56002 (diff)
downloadgcc-f3da0ead0c5c3772c8322cc4aad8deeb382ef2dd.zip
gcc-f3da0ead0c5c3772c8322cc4aad8deeb382ef2dd.tar.gz
gcc-f3da0ead0c5c3772c8322cc4aad8deeb382ef2dd.tar.bz2
tree.c (get_unwidened): Decide whether to narrow a bitfield reference based on TYPE_SIZE...
* 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
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index bc52a6b..7b388dd 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -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;
}