You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
/* This file handles the generation of rtl code from tree structure
above the level of expressions, using subroutines in exp*.c and emit-rtl.c.
if (asm_operand_ok (op, constraint) <= 0)
{
- if (allows_reg)
+ if (allows_reg && TYPE_MODE (type) != BLKmode)
op = force_reg (TYPE_MODE (type), op);
else if (!allows_mem)
warning (0, "asm operand %d probably doesn%'t match constraints",
warn_if_unused_value (tree exp, location_t locus)
{
restart:
- if (TREE_USED (exp))
+ if (TREE_USED (exp) || TREE_NO_WARNING (exp))
return 0;
/* Don't warn about void constructs. This includes casting to void,
goto restart;
case COMPOUND_EXPR:
- if (TREE_NO_WARNING (exp))
- return 0;
if (warn_if_unused_value (TREE_OPERAND (exp, 0), locus))
return 1;
/* Let people do `(foo (), 0)' without a warning. */
exp = TREE_OPERAND (exp, 1);
goto restart;
- case NOP_EXPR:
- case CONVERT_EXPR:
- case NON_LVALUE_EXPR:
- /* Don't warn about conversions not explicit in the user's program. */
- if (TREE_NO_WARNING (exp))
+ case COND_EXPR:
+ /* If this is an expression with side effects, don't warn; this
+ case commonly appears in macro expansions. */
+ if (TREE_SIDE_EFFECTS (exp))
return 0;
- /* Assignment to a cast usually results in a cast of a modify.
- Don't complain about that. There can be an arbitrary number of
- casts before the modify, so we must loop until we find the first
- non-cast expression and then test to see if that is a modify. */
- {
- tree tem = TREE_OPERAND (exp, 0);
-
- while (TREE_CODE (tem) == CONVERT_EXPR || TREE_CODE (tem) == NOP_EXPR)
- tem = TREE_OPERAND (tem, 0);
-
- if (TREE_CODE (tem) == MODIFY_EXPR || TREE_CODE (tem) == INIT_EXPR
- || TREE_CODE (tem) == CALL_EXPR)
- return 0;
- }
- goto maybe_warn;
+ goto warn;
case INDIRECT_REF:
/* Don't warn about automatic dereferencing of references, since
if (EXPRESSION_CLASS_P (exp) && TREE_CODE_LENGTH (TREE_CODE (exp)) == 0)
return 0;
- maybe_warn:
- /* If this is an expression with side effects, don't warn. */
- if (TREE_SIDE_EFFECTS (exp))
- return 0;
-
+ warn:
warning (0, "%Hvalue computed is not used", &locus);
return 1;
}
if (compare_tree_int (minval, 0) > 0
&& compare_tree_int (maxval, GET_MODE_BITSIZE (word_mode)) < 0)
{
- minval = fold_convert (index_type, integer_zero_node);
+ minval = build_int_cst (index_type, 0);
range = maxval;
}
emit_case_bit_tests (index_type, index_expr, minval, range,
#ifndef ASM_OUTPUT_ADDR_DIFF_ELT
|| flag_pic
#endif
+ || !flag_jump_tables
|| TREE_CONSTANT (index_expr)
/* If neither casesi or tablejump is available, we can
only go this way. */
&& compare_tree_int (minval, 0) > 0
&& compare_tree_int (minval, 3) < 0)
{
- minval = fold_convert (index_type, integer_zero_node);
+ minval = build_int_cst (index_type, 0);
range = maxval;
}
return 0;
low_minus_one = fold_build2 (MINUS_EXPR, TREE_TYPE (node->low),
- node->low, integer_one_node);
+ node->low,
+ build_int_cst (TREE_TYPE (node->low), 1));
/* If the subtraction above overflowed, we can't verify anything.
Otherwise, look for a parent that tests our value - 1. */
return 0;
high_plus_one = fold_build2 (PLUS_EXPR, TREE_TYPE (node->high),
- node->high, integer_one_node);
+ node->high,
+ build_int_cst (TREE_TYPE (node->high), 1));
/* If the addition above overflowed, we can't verify anything.
Otherwise, look for a parent that tests our value + 1. */