* rtl.h (truncated_to_mode): Declare it.
(struct rtl_hooks): Add reg_truncated_to_mode hook.
* rtlhooks-def.h (RTL_HOOKS_REG_TRUNCATED_TO_MODE): New macro.
(RTL_HOOKS_INITIALIZER): Include it.
* rtlhooks.c (reg_truncated_to_mode_general): New function.
* combine.c (RTL_HOOKS_REG_TRUNCATED_TO_MODE): Override to
reg_truncated_to_mode.
* rtlanal.c (truncated_to_mode): Define it.
* simplify-rtx.c (simplify_unary_operation_1): Use it.
Co-Authored-By: Adam Nemet <anemet@caviumnetworks.com>
From-SVN: r111573
* tree-chrec.c (chrec_convert_aggressive): Do not eliminate
conversions where TYPE_MIN_VALUE/TYPE_MAX_VALUE do not cover
the range allowed by TYPE_PRECISION.
From-SVN: r111568
2006-02-28 Thomas Koenig <Thomas.Koenig@online.de>
* trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc):
If the mask expression exists and has rank 0, enclose the
generated loop in an "if (mask)". Put the default
initialization into the else branch.
2006-02-28 Thomas Koenig <Thomas.Koenig@online.de>
* scalar_mask_1.f90: Add tests for maxloc with scalar mask.
From-SVN: r111562
(define_memory_constraint, define_address_constraint): New MD forms.
* gensupport.c (process_rtx): Put define_constraint etc on the
predicate queue.
* genpreds.c (process_define_predicate): Adjust comment. Validate
the name, and call validate_exp to validate the expression.
(mark_mode_tests, write_extract_subexp): Can assume correct input.
(write_predicate_expr): Likewise. NAME argument no longer necessary;
all callers changed.
(validate_exp, needs_variable, struct constraint_data)
(constraints_by_letter_table, first_constraint, last_constraint_ptr)
(FOR_ALL_CONSTRAINTS, generic_constraint_letters, const_int_constraints)
(const_dbl_constraints, constraint_max_namelen)
(have_register_constraints, have_memory_constraints)
(have_address_constraints, have_address_constraints)
(have_extra_constraints, have_const_int_constraints)
(have_const_dbl_constraints, mangle, add_constraint)
(process_define_constraint, process_define_register_constraint)
(write_enum_constraint_num, write_lookup_constraint)
(write_insn_constraint_len, write_regclass_for_constraint)
(write_constraint_satisfied_p, write_insn_const_int_ok_for_constraint)
(write_insn_extra_memory_constraint)
(write_insn_extra_address_constraint)
(write_satisfies_constraint_fns): New.
(write_tm_preds_h): If we have new-style constraint definitions,
prototype the functions generated from them, and define the
old constraint interface (still used by generic code) in terms of
those functions.
(write_insn_preds_c): If we have new-style constraint definitions,
generate all relevant functions from those definitions.
(main): Handle define_constraint etc.
* genoutput.c (struct constraint_data, indep_constraints)
(mdep_constraint_letters, constraints_by_letter_table, note_constraint)
(mdep_constraint_len): New data structures and functions, defined
#ifdef USE_MD_CONSTRAINTS.
(check_constraint_len): Don't define #ifdef USE_MD_CONSTRAINTS.
(validate_insn_alternatives): If USE_MD_CONSTRAINTS is defined,
use new logic to validate operand constraints against constraint
definitions.
(main): Process define_constraint etc. if USE_MD_CONSTRAINTS is
defined.
* defaults.h: If none of the old-style constraint macros are
defined, define USE_MD_CONSTRAINTS; do not provide defaults for any
old-style macros; and poison REG_CLASS_FROM_LETTER,
CONST_OK_FOR_LETTER_P, CONST_DOUBLE_OK_FOR_LETTER_P, and
EXTRA_CONSTRAINT.
* recog.c (reg_fits_class_p): If cl is NO_REGS, return 0 immediately.
* doc/md.texi: Document new constraint-definition mechanism and the
C interface it provides. Remove references to old mechanism
elsewhere in the document.
(Machine Constraints): Use pathnames relative to gcc directory,
i.e. config/ARCH/FILE. Change i386 section to refer to
config/i386/predicates.md; update that section to match docstrings.
* doc/tm.texi: Move all documentation of the old constraint-
definition macros to their own section, clearly mark as obsolete.
* config/i386/predicates.md (R, q, Q, l, a, b, c, d, S, D, A, f, t)
(u, y, x, Y, I, J, K, L, M, N, O, G, C, e, Z): New constraint
definitions.
* config/i386/i386.h (REG_CLASS_FROM_LETTER, CONST_OK_FOR_LETTER_P)
(CONST_DOUBLE_OK_FOR_LETTER_P, EXTRA_CONSTRAINT): Delete.
* config/i386/i386.md (*movdf_nointeger): Remove stray 'H' from
constraint strings.
(splits and peepholes): Use satisfies_constraint_*.
* config/i386/i386.c (memory_address_length)
(ix86_attr_length_immediate_default): Use satisfies_constraint_*.
From-SVN: r111508
2006-02-27 Daniel Berlin <dberlin@dberlin.org>
* tree-ssa-structalias.c (get_constraint_for): Move code to deal
with aggregates here.
(find_func_aliases): Remove code for &<aggregate> from here.
From-SVN: r111487
* fold-const.c (fold_binary) <EQ_EXPR>: Fold (~X & C) eq/ne 0 as
(X & C) ne/eq 0, where C is a single bit, i.e. a power of two.
Fold both "((X & C) ^ C) eq/ne 0" and "((X ^ C) & C) eq/ne 0"
as (X & C) ne/eq 0.
* gcc.dg/fold-eqandnot-1.c: New test case.
From-SVN: r111471
PR middle-end/19983
* real.c (real_nan): Allow both 0x and 0X as hexadecimal prefixes.
* gcc.c-torture/execute/ieee/builtin-nan-1.c: New test case.
From-SVN: r111470
* opts.c (decode_options): Do not handle flag_strength_reduce.
(common_handle_option): Handle OPT_floop_optimize, OPT_frerun_loop_opt
and OPT_fstrength_reduce.
* tree-ssa-loop.c (tree_ssa_loop_prefetch): Only test
flag_prefetch_loop_arrays for being nonzero.
* common.opt (floop-optimize, frerun-loop-opt): Resurrected as
no-ops.
(fprefetch-loop-arrays-rtl): Removed.
(flag_prefetch_loop_arrays): Do not specify the value.
* doc/passes.texi: Update documentation of loop optimizer
passes.
* doc/invoke.texi (-fstrength-reduce, -fprefetch-loop-arrays-rtl,
-frerun-loop-opt): Remove.
* gcc.target/i386/20000614-2.c: Do not use -fno-strength-reduce.
* gcc.dg/20030324-1.c: Do not use -fstrength-reduce.
From-SVN: r111469
2006-02-26 Richard Guenther <rguenther@suse.de>
PR tree-optimization/26421
* tree-ssa-alias.c (find_used_portions): Don't treat parameters
in function calls that are ADDR_EXPRs as using the whole structure.
* gcc.dg/tree-ssa/pr26421.c: New testcase.
From-SVN: r111461
gcc/
* common.opt (-floop-optimize, -frerun-loop-opt): Remove.
* tree-pass.h (pass_loop_optimize): Remove.
* passes.c (pass_loop_optimize): Never run it.
* toplev.c (backend_init): Don't call init_loop.
* opts.c (flag_loop_optimize_set): Remove.
(decode_options): Never set flag_loop_optimize or flag_rerun_loop_opt.
(common_handle_option) <OPT_floop_optimize>: Remove. Don't disable
the old RTL loop optimizer when profiling enabled.
* predict.c (tree_estimate_probability): Always strip builtin_expect.
* cfgcleanup.c (try_forward_edges): Don't avoid killing loop
pre-headers for the sake of the old RTL loop optimizer.
* Makefile.in: Remove all references to loop.o.
* doc/invoke.texi: Remove all references to -floop-optimize
and -frerun-loop-opt.
testsuite/
* gcc.dg/20031201-1.c: Don't use -frerun-loop-opt.
* g++.old-deja/g++.robertl/eb132.C: Likewise.
From-SVN: r111459
2006-02-26 Roger Sayle <roger@eyesopen.com>
James A. Morrison <phython@gcc.gnu.org>
PR middle-end/21137
* fold-const.c (fold_binary) <EQ_EXPR>: Fold ((X>>C1)&C2) eq/ne 0,
when C2 is a power of two, as either (X&(C2<<C1)) eq/ne 0 if the
new constant C2<<C1, or as (X<0) or (X,false) depending upon the
signedness of the shift operation.
* gcc.dg/fold-eqandshift-1.c: New test case.
Co-Authored-By: James A. Morrison <phython@gcc.gnu.org>
From-SVN: r111453
* simplify-rtx.c (simplify_relational_operation_1): Simplify
(X^Y) == 0 as X == Y and (X^Y) != 0 as X != Y. Simplify (X^Y) == Y
as X == 0, and some symmetry related transformations.
Simplify (X^C1) == C2 as X == (C1^C2). Split long comment line.
From-SVN: r111443
PR middle-end/23673
* fold-const.c (fold_binary) <EQ_EXPR>: Fold (X^Y) == 0 as X == Y
and (X^Y) != 0 as X != Y. Fold (X^Y) == Y as X == 0, and some
symmetry related transformations. Fold (X^C1) == C2 as
X == (C1^C2).
* gcc.dg/fold-eqxor-1.c: New test case.
* gcc.dg/fold-eqxor-2.c: Likewise.
* gcc.dg/fold-eqxor-3.c: Likewise.
From-SVN: r111442
2006-02-25 Thomas Koenig <Thomas.Koenig@online.de>
PR fortran/23092
* trans-intrinsic.c (gfc_conv_intrinsic_arith): If the
mask expression exists and has rank 0, enclose the generated
loop in an "if (mask)".
* (gfc_conv_intrinsic_minmaxloc): Likewise.
2006-02-25 Thomas Koenig <Thomas.Koenig@online.de>
PR fortran/23092
* scalar_mask_1.f90: New test.
From-SVN: r111438
PR middle-end/24952
* combine.c (try_combine): Explicitly check whether GET_CODE is
a SET or a CLOBBER, instead on checking that it isn't a USE.
From-SVN: r111425
* fold-const.c (fold_comparison): New subroutine of fold_binary
containing transformations common to both the equality and
ordering relational operators, factored out of fold_binary.
(fold_binary): Separate out the equality operators (EQ_EXPR
and NE_EXPR) from the ordering operators (LT_EXPR, GT_EXPR,
LE_EXPR and GE_EXPR), calling fold_comparison to perform the
transformations common to both.
(fold_div_compare): Fix latent bugs in the previously unreachable
LT_EXPR and GE_EXPR cases.
From-SVN: r111423