* read-rtl.c (struct macro_traverse_data): Add unknown_mode_attr
field.
(mode_attr_index): Remove check for defined attribute. Remove
infile parameter. Change all callers.
(apply_mode_maps): Add unknown parameter. Change caller. Always
return after finding attribute.
(apply_macro_to_rtx): Add unknown_mode_attr parameter. Change
callers.
(apply_macro_traverse): Set mtd->unknown_mode_attr.
(read_rtx): Use mtd.unknown_mode_attr to check for an undefined
attribute used for a mode.
Paolo Bonzini [Tue, 17 May 2005 09:55:44 +0000 (09:55 +0000)]
Makefile.in: Add tree-ssa-math-opts.c.
gcc:
2005-05-17 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in: Add tree-ssa-math-opts.c.
* expr.c (expand_expr_real_1) <case RDIV_EXPR>: Never emit as a*(1/b).
* fold-const.c (distribute_real_division): New.
(fold_binary) <case PLUS_EXPR, case MINUS_EXPR>: Use it.
* tree-pass.h (pass_cse_reciprocals): New.
* tree-optimize.c (init_tree_optimization_passes): Run it.
* tree-ssa-math-opts.c: New file.
* doc/passes.texi: Document the new pass.
gcc/testsuite:
2005-05-17 Paolo Bonzini <bonzini@gnu.org>
* Makefile.am (all_native_compiled_source_files,
(all_native_compiled_dirs, all_java_dirs, all_java_lo_files,
all_libgcj_lo_files, all_xlib_lo_files,
all_java_deps_files, all_java_stamp_files,
all_java_filelist_files): New variables.
(EXTRA_DIST): New Automake variable.
(CLEANFILES): Add .stamp, .list and .lo files.
(%.list, %.lo, %.stamp, Makefile.deps): New rules.
(classes.stamp): Depend on $(all_java_stamp_files).
(libgcj.la): Pass $(libgcj_la_LIBADD) to the linker without
going through write_entries_to_file.
* varasm.c (struct constant_descriptor_tree): Add hash field.
(const_desc_hash): Just return hash field.
(const_desc_eq): If hash values are different, return 0 immediately.
(output_constant_def): Compute hash field of temporary key, use
htab_find_slot_with_hash instead of htab_find_slot. Set hash in
newly built constant descriptor.
(lookup_constant_def): Compute hash field of temporary key, use
htab_find_with_hash instead of htab_find.
Jakub Jelinek [Tue, 17 May 2005 06:31:51 +0000 (08:31 +0200)]
re PR fortran/15080 (Forall bounds not calculated correctly (forall_3.f90))
PR fortran/15080
* trans-stmt.c (generate_loop_for_temp_to_lhs): Remove SIZE and COUNT2
arguments. If LSS is gfc_ss_terminator, increment COUNT1 by 1, instead
of incrementing COUNT2 and using COUNT1+COUNT2 increment COUNT1 and use
just that as index.
(generate_loop_for_rhs_to_temp): Likewise.
(compute_overall_iter_number): Add INNER_SIZE_BODY argument.
It non-NULL, add it to body.
(allocate_temp_for_forall_nest_1): New function, split from
allocate_temp_for_forall_nest.
(allocate_temp_for_forall_nest): Add INNER_SIZE_BODY argument,
propagate it down to compute_overall_iter_number. Use
allocate_temp_for_forall_nest_1.
(gfc_trans_assign_need_temp): Remove COUNT2. Call
compute_inner_temp_size into a new stmtblock_t. Adjust calls to
allocate_temp_for_forall_nest, generate_loop_for_rhs_to_temp
and generate_loop_for_temp_to_lhs.
(gfc_trans_pointer_assign_need_temp): Adjust calls to
allocate_temp_for_forall_nest.
(gfc_evaluate_where_mask): Call compute_inner_temp_size into a new
stmtblock_t. Call compute_overall_iter_number just once, then
allocate_temp_for_forall_nest_1 twice with the same size.
Initialize mask indexes if nested_forall_info != NULL.
(gfc_trans_where_2): Initialize mask indexes before calling
gfc_trans_nested_forall_loop.
* gfortran.fortran-torture/execute/forall_3.f90: Remove comment
about the test failing.
* gfortran.fortran-torture/execute/where_7.f90: New test.
* gfortran.fortran-torture/execute/where_8.f90: New test.
Mark Mitchell [Mon, 16 May 2005 22:52:26 +0000 (22:52 +0000)]
generate-random.c (config.h): Do not include.
* gcc.dg/compat/generate-random.c (config.h): Do not include.
(limits.h): Include unconditionally.
(stdlib.h): Likewise.
* gcc.dg/compat/generate-random_r.c (config.h): Do not include.
(limits.h): Include unconditionally.
(stdlib.h): Likewise.
* gcc.dg/compat/struct-layout-1.exp: Do not link with libiberty.
* gcc.dg/compat/struct-layout-1_generate.c (config.h): Do not include.
(limits.h): Include unconditionally.
(stdlib.h): Likewise.
(hashtab.h): Do not include.
(getopt.h): Likewise.
(stddef.h): Include.
(hashval_t): Define.
(struct entry): Add "next" field.
(HASH_SIZE): New macro.
(hash_table): New variable.
(switchfiles): Do not use xmalloc.
(mix): New macro.
(iterative_hash): New function.
(hasht): Remove.
(e_exists): New function.
(e_insert): Likewise.
(output): Use, instead of libiberty hashtable functions.
(main): Do not use getopt. Do not call htab_create.
Caroline Tice [Mon, 16 May 2005 21:37:01 +0000 (21:37 +0000)]
bb-reorder.c (verify_hot_cold_block_grouping): Replace internal_error with gcc_assert.
2005-05-16 Caroline Tice <ctice@apple.com>
* bb-reorder.c (verify_hot_cold_block_grouping): Replace
internal_error with gcc_assert.
* dwarf2out.c (dwarf2out_switch_text_section): Likewise.
* function.h (struct function): Remove space between "*" and
struct field names.
* varasm.c (initialize_cold_section_name): Add gcc_assert;
modify to use alloca.
(unlikely_text_section): Add check for flag_function_sections.
(assemble_start_function): Move call to resolve_section, so it
comes before first call to unlikely_text_section.
(assemble_end_function): Add test and call to function_section
if appropriate.
Roger Sayle [Mon, 16 May 2005 19:40:35 +0000 (19:40 +0000)]
c-common.c (c_common_truthvalue_conversion): Use fold_build2 instead of build_binary_op when...
* c-common.c (c_common_truthvalue_conversion): Use fold_build2
instead of build_binary_op when performing code transformations
to avoid error messages about constructs not it the user's code.
Kazu Hirata [Mon, 16 May 2005 15:18:15 +0000 (15:18 +0000)]
tree-data-ref.c (compute_all_dependences): Change the type of dependence_relations to VEC(ddr_p,heap)**.
* tree-data-ref.c (compute_all_dependences): Change the type
of dependence_relations to VEC(ddr_p,heap)**.
(compute_data_dependences_for_loop): Change the type of
allrelations to VEC(ddr_p,heap)*.
Kazu Hirata [Mon, 16 May 2005 15:11:33 +0000 (15:11 +0000)]
dwarf2out.c (used_rtx_varray): Rename to used_rtx_array.
* dwarf2out.c (used_rtx_varray): Rename to used_rtx_array.
Change the type to VEC(rtx,gc)*.
(mem_loc_descriptor, add_const_value_attributes,
dwarf2out_init): Adjust uses of used_rtx_varray.
Makefile.in (options.c): Tell optc-gen.awk to include config.h, system.h, coretypes.h and tm.h.
* Makefile.in (options.c): Tell optc-gen.awk to include config.h,
system.h, coretypes.h and tm.h.
(options.o): Update dependencies accordingly.
* optc-gen.awk: Allow header_name to be a list of filenames.
Handle the "Condition" flag.
* opts.h (CL_DISABLED): New flag.
* opts.c (handle_option): Print an error for CL_DISABLED options.
* doc/options.texi: Document the "Condition" option flag.
Roger Sayle [Mon, 16 May 2005 04:36:09 +0000 (04:36 +0000)]
tree-scalar-evolution.c (set_nb_iterations_in_loop): Only check for TREE_OVERFLOW on INTEGER_CST trees.
* tree-scalar-evolution.c (set_nb_iterations_in_loop): Only
check for TREE_OVERFLOW on INTEGER_CST trees.
* tree-chrec.c (chrec_convert): Only clear TREE_OVERFLOW on
CONSTANT_CLASS_P tree nodes.
Daniel Berlin [Mon, 16 May 2005 01:12:07 +0000 (01:12 +0000)]
re PR tree-optimization/21576 (FRE does not eliminate a redundant builtin call.)
2005-05-15 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/21576
* tree-ssa-pre.c (expression_node_pool): New pool.
(comparison_node_pool): Ditto.
(list_node_pool): Ditto.
(pool_copy_list): New function.
(phi_translate): Handle CALL_EXPR.
(valid_in_set): Ditto.
(create_expression_by_pieces): Ditto.
(insert_into_preds_of_block): Ditto.
(insert_aux): Ditto.
(compute_avail): Ditto.
(create_value_expr_from): Handle TREE_LIST and CALL_EXPR.
(can_value_number_call): New function.
(find_leader): Update comment.
(init_pre): Create new pools.
(fini_pre): Free new pools.
(pass_pre): Add TODO_update_ssa for the future when we are going
to need vops.
* tree-vn.c (expressions_equal_p): Handle TREE_LIST.
(set_value_handle): Ditto.
(get_value_handle): Ditto.
re PR libstdc++/21526 (libstdc++-v3 testsuite hangs on cygwin)
2005-05-16 David Billinghurst <David.Billinghurst@riotinto.com>
PR libstdc++/21526
* lib/target-supports.exp (check_mkfifo_available):
Return 0 for cygwin as mkfifo support incomplete on platform.
Fix typos in comments.
Gabriel Dos Reis [Sun, 15 May 2005 18:28:36 +0000 (18:28 +0000)]
fixlib.c (load_file_data): Use XRESIZVEC in lieu of xrealloc.
* fixlib.c (load_file_data): Use XRESIZVEC in lieu of xrealloc.
* server.c (load_data): Likewise.
(run_shell): Use XCNEW (char) in lieu of xcalloc (1, 1).
* fixincl.c: #include <sys/wait.h>
(run_compiles): Use XCNEWVEC instead of xcalloc.
(fix_with_system, start_fixer): Use XNEWVEC instead of xmalloc.
* fixfixes.c (FIX_PROC_HEAD, main): Likewise.
* Makefile.am: Remove AM_CFLAGS here.
* configure.ac: Define AM_CFLAGS and AM_FCFLAGS so that warnings
are set. Set additionally -Wstrict-prototypes for CFLAGS.
* Makefile.in: Regenerated
* configure: Regenerated.
Feng Wang [Sun, 15 May 2005 02:45:29 +0000 (02:45 +0000)]
[multiple changes]
2005-05-15 Feng Wang <fengwang@nudt.edu.cn>
Jerry DeLisle <jvdelisle@verizon.net>
PR fortran/17432
* trans-stmt.c (gfc_trans_label_assign): fix pointer type, to
resolve ICE on assign of format label.
* trans-io.c (set_string): add fold-convert to properly
handle assigned format label in write.
2005-05-15 Jerry DeLisle <jvdelisle@verizon.net>
PR fortran/17432
* gfortran.dg/assign_4.f: New test.
Kaz Kojima [Sun, 15 May 2005 02:02:58 +0000 (02:02 +0000)]
sh.c (sh_output_mi_thunk): Check cfun->cfg instead of basic_block_info.
* config/sh/sh.c (sh_output_mi_thunk): Check cfun->cfg instead
of basic_block_info. Call init_flow and find_basic_blocks
before dbr_schedule if needed.
Kazu Hirata [Sat, 14 May 2005 20:32:59 +0000 (20:32 +0000)]
re PR tree-optimization/21563 (A trivial VRP opportunity missed)
gcc/
PR tree-optimization/21563
* tree-vrp.c (compare_value): Return boolean_false_node when
SSA_NAME in "if (SSA_NAME == CST)" is strictly smaller than or
strictly larger than CST.
* config/vax/vax.md: define_constant VAXens AP, FP, SP and PC
registers and use them (specifically the stack pointer).
* config/vax/vax.h: Use above defines right here.
Richard Guenther [Sat, 14 May 2005 15:42:01 +0000 (15:42 +0000)]
revert: fold-const.c (fold_indirect_ref_1): Avoid removing NOP_EXPRs with type qualifiers like const.
2005-05-14 Richard Guenther <rguenth@gcc.gnu.org>
Revert
2005-05-11 Richard Guenther <rguenth@gcc.gnu.org>
* fold-const.c (fold_indirect_ref_1): Avoid removing
NOP_EXPRs with type qualifiers like const.
Jan Hubicka [Sat, 14 May 2005 14:24:49 +0000 (16:24 +0200)]
tree-cfg.c (execute_warn_function_return): Break out noreturn warning too..
* tree-cfg.c (execute_warn_function_return): Break out noreturn
warning too..
(execute_warn_function_noreturn): ... here.
(pass_warn_function_noreturn): New pass.
* tree-pass.h (pass_warn_function_noreturn): Declare
* tree-optimize.c (init_tree_optimization_passes): Move return
warnings early and add noreturn warnings at place of previous
return warnings.
Kazu Hirata [Sat, 14 May 2005 13:05:37 +0000 (13:05 +0000)]
tree-ssa-live.c (tpa_init, [...]): Use VEC instead of VARRAY.
* tree-ssa-live.c (tpa_init, tpa_delete, tpa_compact,
root_var_init, type_var_init): Use VEC instead of VARRAY.
* tree-ssa-live.h (tree_partition_associator_d): Change the
type of trees to VEC(tree,heap)*.
(tpa_tree): Use VEC instead of VARRAY.
Kazu Hirata [Sat, 14 May 2005 03:25:44 +0000 (03:25 +0000)]
tree-eh.c (leh_tf_state): Change the type of dest_array to VEC(tree,heap)*.
* tree-eh.c (leh_tf_state): Change the type of dest_array to
VEC(tree,heap)*.
(maybe_record_in_goto_queue, lower_try_finally_onedest,
lower_try_finally_copy, lower_try_finally_switch,
lower_try_finally): Use VEC instead of VARRAY.
Josh Conner [Fri, 13 May 2005 21:13:17 +0000 (21:13 +0000)]
arm.c (arm_size_return_regs): New.
2005-05-13 Josh Conner <jconner@apple.com>
* config/arm/arm.c (arm_size_return_regs): New.
(thumb_unexpanded_epilogue): replace in-line calculation
of return registers with call to arm_size_return_regs.
(use_return_insn): Include test of which registers are
being used to hold return values, to accommodate
vector return values.
* config/cris/cris.h (CRIS_ASSERT): New macro.
* config/cris/cris.md ("*movsi_internal"): Use CRIS_ASSERT and
internal_error instead of abort.
("movsi"): Ditto. Unquote preparation statement section.
* config/cris/cris.c (ASSERT_PLT_UNSPEC): Define in terms of
CRIS_ASSERT.
("call", "call_value"): Ditto, but use gcc_assert where
appropriate. Tweak comments.
(cris_op_str): Call internal_error, not abort.
(cris_print_operand): Tweak "abort" reference to "die" in comment.
(cris_initial_elimination_offset): Call gcc_unreachable, not abort.
(cris_notice_update_cc): Call internal_error, not abort.
(cris_expand_return, cris_expand_prologue, cris_gen_movem_load)
(cris_emit_movem_store, cris_asm_output_symbol_ref)
(cris_output_addr_const_extra): Use CRIS_ASSERT, don't call abort.
(cris_symbol, cris_got_symbol): Use CRIS_ASSERT instead of
ENABLE_CHECKING-guarded abort call.
(cris_split_movdx): Use CRIS_ASSERT instead of abort with test.
Use internal_error at end of test-chain.