From 23ec9bd9ae1e56457e417f6d9ba85eb87dfc447f Mon Sep 17 00:00:00 2001 From: jason Date: Sat, 20 Dec 2003 03:21:25 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74871 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 12 ++++++++++++ gcc/cp/ChangeLog | 2 ++ gcc/cp/cvt.c | 3 ++- gcc/stmt.c | 9 +++++++++ gcc/tree.c | 2 +- 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eea65d3..a8b38df 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2003-12-19 Jason Merrill + + * 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 * flow.c (mark_set_regs, case PARALLEL): Scan loop forwards. @@ -27,10 +37,12 @@ decimal formats. 2003-12-19 Stuart Hastings + * 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 + * config/rs6000/rs6000.c (legitimate_lo_sum_address_p): Add code to recognize macho-style lo_sum adrress patterns. diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f57eb1b..91fb9df 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 6f4af7d..6d4b961 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -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) { 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; } diff --git a/gcc/tree.c b/gcc/tree.c index 52faeaf..b252a67 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -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) -- 2.7.4